mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-02 11:36:54 -04:00
fix: avoid infinite loop which causes some breakage
This commit is contained in:
parent
8948c331ee
commit
0f9bdb0939
1 changed files with 1 additions and 1 deletions
|
|
@ -67,7 +67,7 @@ function M.get_indent(lnum)
|
|||
if prevnonblank ~= lnum then
|
||||
local prev_node = get_node_at_line(root, prevnonblank-1)
|
||||
-- get previous node in any case to avoid erroring
|
||||
while not prev_node do
|
||||
while not prev_node and prevnonblank-1 > 0 do
|
||||
prevnonblank = vim.fn.prevnonblank(prevnonblank-1)
|
||||
prev_node = get_node_at_line(root, prevnonblank-1)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue