You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. I'm trying to add ability to jump to the end of each snippet. I can add this to my snippets, but I want to also be able to do this with lsp snippets. I wrote autocmd
vim.api.nvim_create_autocmd("User", {
pattern = "LuasnipPreExpand",
--once = true,
callback = function()
local snippet = require("luasnip").session.event_node
local docstring = snippet:get_docstring()
if not docstring[#docstring]:match('%$0$') then
local luasnip = require'luasnip'
local s = luasnip.s
local i = luasnip.i
local t = luasnip.t
luasnip.snip_expand(
s('surrounding snippet', {t("", ""), i(0)})
)
end
end
})
but it adds empty snippet after the one that triggered the event. This works if i have link_roots = true in config, but i would prefer to disable it. Also this doesn't work without the text node, but I assume that it's because it becomes nothing-snippet.
Is there some other way to achieve this?
The text was updated successfully, but these errors were encountered:
Hello. I'm trying to add ability to jump to the end of each snippet. I can add this to my snippets, but I want to also be able to do this with lsp snippets. I wrote autocmd
but it adds empty snippet after the one that triggered the event. This works if i have
link_roots = true
in config, but i would prefer to disable it. Also this doesn't work without the text node, but I assume that it's because it becomes nothing-snippet.Is there some other way to achieve this?
The text was updated successfully, but these errors were encountered: