Skip to content

Commit

Permalink
don't continue after error!
Browse files Browse the repository at this point in the history
  • Loading branch information
L3MON4D3 committed Sep 6, 2023
1 parent 18dffb9 commit eff529e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lua/luasnip/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@ local function exit_out_of_region(node)

if not ok then
remove_snip_set_adjacent_as_current(snippet, "Error while getting extmark-position: %s", snip_begin_pos)
return
end

-- stylua: ignore
Expand All @@ -618,12 +619,14 @@ local function exit_out_of_region(node)
local leave_ok, errmsg = pcall(node_util.leave_nodes_between, snippet, node, true)
if not leave_ok then
remove_snip_set_adjacent_as_current(snippet, "Error while leaving nodes: %s", errmsg)
return
end
-- leave_nodes_between does not leave snippet, have to do this
-- here.
leave_ok, errmsg = pcall(snippet.input_leave, snippet, true)
if not leave_ok then
remove_snip_set_adjacent_as_current(snippet, "Error while leaving nodes: %s", errmsg)
return
end

local next_active = snippet.insert_nodes[0]
Expand Down

0 comments on commit eff529e

Please sign in to comment.