Skip to content

Commit 1cca23c

Browse files
authored
Merge pull request #224 from pnwatin/main
fix neovim freeze when closing a type_identifier
2 parents f2d24ac + e451e0c commit 1cca23c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lua/nvim-ts-autotag/internal.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,13 @@ local function is_in_template_tag()
4444
local has_template_string = false
4545

4646
local current_node = cursor_node
47+
local visited_nodes = {}
4748
while not (has_element and has_template_string) and current_node do
49+
local node_id = current_node:id()
50+
if visited_nodes[node_id] then
51+
break
52+
end
53+
visited_nodes[node_id] = true
4854
if not has_element and current_node:type() == "element" then
4955
has_element = true
5056
end

0 commit comments

Comments
 (0)