mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 02:38:46 +00:00
fix(scope): return nil
when buffer is empty for indent scope
This commit is contained in:
parent
1091280877
commit
4aa378a35e
1 changed files with 4 additions and 0 deletions
|
@ -160,6 +160,10 @@ function IndentScope:find(opts)
|
|||
next_i, next_l = Scope.get_indent(vim.fn.nextnonblank(line + 1))
|
||||
end
|
||||
|
||||
if line == 0 then
|
||||
return
|
||||
end
|
||||
|
||||
-- adjust line to the nearest indent block
|
||||
if prev_i <= indent and next_i > indent then
|
||||
line = next_l
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue