Skip to content

Commit c0e5f64

Browse files
luowentaoandersevenrud
luowentao
authored andcommitted
fix: dead loop
1 parent 03fb506 commit c0e5f64

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lua/nvim_context_vt/utils.lua

+7-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,13 @@ M.find_virtual_text_nodes = function(validator, ft, opts)
6565
table.insert(result[target_line], node)
6666
end
6767

68-
node = node:parent()
68+
local pnode = node:parent()
69+
if pnode == node then
70+
-- in case of dead loop
71+
break
72+
else
73+
node = pnode
74+
end
6975
end
7076

7177
return result

0 commit comments

Comments
 (0)