mirror of
https://github.com/L3MON4D3/LuaSnip
synced 2024-09-16 13:44:04 +02:00
Format with stylua
This commit is contained in:
parent
f7205269b7
commit
b84eeb3641
2 changed files with 8 additions and 5 deletions
|
@ -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, {})
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue