Skip to content

Commit 5a1e392

Browse files
L3MON4D3github-actions[bot]
authored andcommitted
Format with stylua
1 parent aadc576 commit 5a1e392

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

lua/luasnip/nodes/snippet.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,11 @@ end
297297
local function verify_nodes(nodes)
298298
for i, node in ipairs(nodes) do
299299
if node.parent then
300-
error("Node at position " .. i .. " is already initialized! This is forbidden, generate a new node and pass it instead.")
300+
error(
301+
"Node at position "
302+
.. i
303+
.. " is already initialized! This is forbidden, generate a new node and pass it instead."
304+
)
301305
end
302306
end
303307
end

tests/integration/snippet_basics_spec.lua

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1667,12 +1667,18 @@ describe("snippets_basic", function()
16671667
end
16681668
)
16691669
it("throws error when reusing nodes", function()
1670-
local ok, err = pcall(exec_lua, [[
1670+
local ok, err = pcall(
1671+
exec_lua,
1672+
[[
16711673
local i1 = i(1)
16721674
local snipA = ls.s({trig="asdf"}, {i1})
16731675
local snipB = ls.s({trig="asdf"}, {i1})
1674-
]])
1676+
]]
1677+
)
16751678
assert(not ok, "Throws error")
1676-
assert(err:match("Node at position 1 is already initialized") ~= nil, "Throws correct error")
1679+
assert(
1680+
err:match("Node at position 1 is already initialized") ~= nil,
1681+
"Throws correct error"
1682+
)
16771683
end)
16781684
end)

0 commit comments

Comments
 (0)