hsnips icon indicating copy to clipboard operation
hsnips copied to clipboard

Nested snippet is placed after first snippet.

Open imfhm opened this issue 1 year ago • 2 comments

So I tried the workaround of issue #189 provided by @superle3, but now I have a new problem.

Say I have two snippets

snippet // "Fraction simple" A \frac{$1}{$2}$0 endsnippet

snippet \b([a-zA-Z])bar\b "bar" A rv = '\\bar{' + m[1] + '}'$0 endsnippet

Writing "//tbar" I would expect that // expands to "\frac{|}{}" with the cursor being between the first two brackets and "tbar" expanding to "\bar{t}", resulting in "\frac{\bar{t}}{}".

But what I get is "\frac{}{}\bar{t}", so \bar{t} is placed afterwards. With the VIM extension disabled this does not happen, but as Neovim for VSCode is quite slow (at least for me, for some reason) I don't know of any alternative. Anyone have an idea?

PS: Downgrading to 1.85.2 did not help.

imfhm avatar Oct 14 '24 21:10 imfhm

Edit: After trying out Neovim again and using an init.vim instead of an init.lua, the performance has greatly improved. Maybe I did something wrong before, effecting the performance. Nevertheless, I would still be curious why the above happens!

imfhm avatar Oct 15 '24 06:10 imfhm

I am guessing something goes wrong when deleting the trigger, since this doesn't happen for just inserting snippets normally with the command insertsnippet.

superle3 avatar Oct 16 '24 19:10 superle3