Format with stylua

This commit is contained in:
L3MON4D3 2024-08-06 21:26:37 +00:00 committed by github-actions[bot]
parent f7205269b7
commit b84eeb3641
2 changed files with 8 additions and 5 deletions

View file

@ -632,8 +632,10 @@ end
function Snippet:trigger_expand(current_node, pos_id, env, indent_nodes)
local pos = vim.api.nvim_buf_get_extmark_by_id(0, session.ns_id, pos_id, {})
local pre_expand_res = self:event(events.pre_expand, { expand_pos = pos, expand_pos_mark_id = pos_id })
or {}
local pre_expand_res = self:event(
events.pre_expand,
{ expand_pos = pos, expand_pos_mark_id = pos_id }
) or {}
-- update pos, event-callback might have moved the extmark.
pos = vim.api.nvim_buf_get_extmark_by_id(0, session.ns_id, pos_id, {})

View file

@ -1630,7 +1630,7 @@ describe("snippets_basic", function()
it("expand-position may be moved in pre_expand.", function()
feed("i.")
exec_lua[[
exec_lua([[
snip = s("foo", {
t"asdf"
}, {callbacks = {[-1] = { [events.pre_expand] = function(node, event_args)
@ -1638,12 +1638,13 @@ describe("snippets_basic", function()
end}} } )
ls.snip_expand(snip)
]]
]])
screen:expect({
grid = [[
asdf^. |
{0:~ }|
{2:-- INSERT --} |]]})
{2:-- INSERT --} |]],
})
end)
end)