Skip to content

Commit

Permalink
leave snippet if node-to-focus is i(0).
Browse files Browse the repository at this point in the history
  • Loading branch information
L3MON4D3 committed Jul 22, 2023
1 parent ae26853 commit 8ecab5f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lua/luasnip/nodes/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,10 @@ local function refocus(from, to)
if final_leave_node.type == types.exitNode and first_enter_node.type ~= types.exitNode then
common_node:input_enter()
end
-- symmetrically, entering an i(0)/i(-1) requires leaving the snippet.
if final_leave_node.type ~= types.exitNode and first_enter_node.type == types.exitNode then
common_node:input_leave()
end
enter_nodes_between(common_node, first_enter_node, true)
first_enter_node:input_enter_children()
end
Expand Down

0 comments on commit 8ecab5f

Please sign in to comment.