diff --git a/lua/nvim-treesitter/indent.lua b/lua/nvim-treesitter/indent.lua index 5a013ba7a..7779e9bdd 100644 --- a/lua/nvim-treesitter/indent.lua +++ b/lua/nvim-treesitter/indent.lua @@ -179,7 +179,9 @@ function M.get_indent(lnum) end -- Recursively search upwards for any @indent.end nodes local tmp = node - while tmp and not q["indent.end"][tmp:id()] do tmp = tmp:parent() end + while tmp and not q["indent.end"][tmp:id()] do + tmp = tmp:parent() + end if tmp then node = get_first_node_at_line(root, lnum) end