ultisnips icon indicating copy to clipboard operation
ultisnips copied to clipboard

Tabstops not working properly with delimiters

Open Hyrhie opened this issue 1 year ago • 1 comments

Tabstops are not working properly when using snippets with delimiters. For example, if I have something of the kind

snippet _ "subscript" iA
_{$1}$0
endsnippet

it should first expand like {|} (here I'm using | to denote the cursor place) and then go to the second tabstop, like {}|. But for some reason, sometimes, even after pressing the next tabstop trigger (which I've set to jk) the cursor just blinks and stays right before the end of the delimiter (for example, after A_{1} it would stay like A_{1|} instead of A_{1}|).

When I say "sometimes" I mean it. This behavior triggers for some reason and after that all the snippets with delimiters stop working properly. And then it randomly starts working fine again. I can't get what triggers the behavior though.

Furthermore, it apparently is not bounded to happen just with {}. Something of the kind

snippet mk "inline math" wA
\$ $1 \$$0
endsnippet

is also not working properly.

Does someone have any idea about what's happening?

Hyrhie avatar Mar 08 '25 10:03 Hyrhie

It is likely a race condition in the internals of Vim. It would help if you could please provide a fully reproducible example, ideally using the approach explained in https://github.com/SirVer/ultisnips/blob/master/CONTRIBUTING.md#reproducing-bugs or if not possible with a minimal vimrc and snippets files and an exact sequence of key strokes that trigger the bug.

SirVer avatar Mar 09 '25 13:03 SirVer

Closing as can't reproduce.

SirVer avatar Jul 05 '25 18:07 SirVer