Skip to content

Commit

Permalink
fix: dead loop
Browse files Browse the repository at this point in the history
  • Loading branch information
luowentao authored and andersevenrud committed Dec 21, 2024
1 parent 03fb506 commit c0e5f64
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lua/nvim_context_vt/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ M.find_virtual_text_nodes = function(validator, ft, opts)
table.insert(result[target_line], node)
end

node = node:parent()
local pnode = node:parent()
if pnode == node then
-- in case of dead loop
break
else
node = pnode
end
end

return result
Expand Down

0 comments on commit c0e5f64

Please sign in to comment.