From 81d83ec368c1e613ce04199d63887cee1a840cec Mon Sep 17 00:00:00 2001 From: L3MON4D3 Date: Wed, 14 Feb 2024 17:00:05 +0000 Subject: [PATCH] Format with stylua --- lua/luasnip/nodes/util.lua | 14 ++++++++++---- tests/integration/snippet_basics_spec.lua | 14 ++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lua/luasnip/nodes/util.lua b/lua/luasnip/nodes/util.lua index be6bd8f56..6c9f49ad9 100644 --- a/lua/luasnip/nodes/util.lua +++ b/lua/luasnip/nodes/util.lua @@ -519,8 +519,11 @@ local function refocus(from, to) -- here. -- snippet does not have input_leave_children, so only input_leave -- needs to be called. - ok2 = - pcall(from.parent.snippet.input_leave, from.parent.snippet, true) + ok2 = pcall( + from.parent.snippet.input_leave, + from.parent.snippet, + true + ) end if not ok1 or not ok2 then from.parent.snippet:remove_from_jumplist() @@ -536,8 +539,11 @@ local function refocus(from, to) ok3 = true else ok2 = pcall(leave_nodes_between, node.parent.snippet, node, true) - ok3 = - pcall(node.parent.snippet.input_leave, node.parent.snippet, true) + ok3 = pcall( + node.parent.snippet.input_leave, + node.parent.snippet, + true + ) end if not ok1 or not ok2 or not ok3 then diff --git a/tests/integration/snippet_basics_spec.lua b/tests/integration/snippet_basics_spec.lua index 5307763a1..d37fe68c4 100644 --- a/tests/integration/snippet_basics_spec.lua +++ b/tests/integration/snippet_basics_spec.lua @@ -1433,23 +1433,17 @@ describe("snippets_basic", function() end) it("node-event is not triggered twice for exitNode.", function() - exec_lua[[ + exec_lua([[ counter = 0 snip = s("mk", t"asdf", {callbacks = {[-1] = {[events.leave] = function() counter = counter + 1 end}}}) - ]] + ]]) exec_lua([[ls.snip_expand(snip)]]) - assert.are.same( - 1, - exec_lua("return counter") - ) + assert.are.same(1, exec_lua("return counter")) -- +1 for entering the exit-node of the second expansion. exec_lua([[ls.snip_expand(snip)]]) - assert.are.same( - 2, - exec_lua("return counter") - ) + assert.are.same(2, exec_lua("return counter")) end) end)