Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested snippet is placed after first snippet. #200

Open
imfhm opened this issue Oct 14, 2024 · 2 comments
Open

Nested snippet is placed after first snippet. #200

imfhm opened this issue Oct 14, 2024 · 2 comments

Comments

@imfhm
Copy link

imfhm commented Oct 14, 2024

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
Copy link
Author

imfhm commented Oct 15, 2024

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!

@superle3
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants