hsnips icon indicating copy to clipboard operation
hsnips copied to clipboard

Tabstop information is lost when using nested snippets

Open oiiiiiiii opened this issue 1 year ago • 1 comments

Say I have these snippets:

snippet $$$ "inline Math" iA
$ $1 $``
let test = t[1][0];
console.log(t)
if (test === undefined) {
  rv = '';
}
else if (test == ':' || test == ',' ||  test == '.' || test =='?' || test ==' ' || test =='-'){
	rv = '';
}
else{
	rv = ' ';
}``$2
endsnippet

snippet tt "test" wA
text $1 after
endsnippet

And I trigger the test snippet inside the $$$ snippet. When I trigger the snippet, the content is added to the t-array. But after that, the content is no longer updated, and therefore "outer" snippets possibly don't work as intended anymore. See image for console output (I typed more after inserting the snippet, but no updates): grafik

Strangely though it does keep the information if I enter nothing in the first tabstop and just move on to the next:

grafik

oiiiiiiii avatar Mar 09 '23 20:03 oiiiiiiii

This also happens with all extensions disabled and has nothing to do with the VSCodeVim extension.

oiiiiiiii avatar Mar 09 '23 20:03 oiiiiiiii