Open DasGandlaf opened 2 months ago
I also have this issue with vs code snippets ("rafamadriz/friendly-snippets"). Jumps to the first parameter but cannot jump further.
Mhh, the first part of you problem-description sounds like you're just missing the SELECT-keybinding (set via smap
or vim.keymap.set({"s", ...}, ...)
).
What you observedafter that, with the current_nodes
being set to nil happens when the snippet-text is modified in such a way that luasnip can't tell what happened to it, which usually is because the buffer was formatted. Could you disable all formatters, and check what happens?
I'm not fully sure what you mean with the select mapping. In the code snippet, I map insert and select mode:
vim.keymap.set({"i", "s"}, "<c-n>", function() ls.jump( 1) end, {silent = true, noremap = true})
vim.keymap.set({"i", "s"}, "<c-p>", function() ls.jump(-1) end, {silent = true, noremap = true})
Do you mean something else?
With regards to the formatting, I do not have any formatting enabled, and when expanding a snippet, the buffer does not get formatted either. So current_nodes
is being set to nil even without formatting.
Also I'm not even sure if the problem is with current_nodes
, it's just something I found out while trying to find the mistake. It might not have to do anything with the problem, but from my limited knowledge, it seems that it is a problem.
I really appreciate your help!
Ah, I thought you might have used the <Tab>
-mapping since that was mapped to ls.expand_or_jump
as opposed to just ls.expand
Could you enable logging via ls.log.set_loglevel("info")
, produce the issue, and then check your log via ls.log.open()
? There should be some information on why the current snippet was unlinked
Hey, thanks for this amazing plugin!
When I have this code:
ls.jump()
works when using snippetfoo1
. It doesn't work when using snippetfoo2
.When expanding, it selects the placeholder
one
correctly. Butls.jump()
does not work.When logging
session.current_nodes
injump()
inluasnip/init.lua
it returns{}
.When expanding foo2,
session.current_nodes
is set to nil (= next_current) inunlink_set_adjacent_as_current_no_log()
.What could the problem be? Thanks!