Is this a BUG REPORT or FEATURE REQUEST? (choose one):
BUG REPORT
What happened:
Simple snippet with duplicate tabstop doesn't work properly.
What did you expect to happen:
Expected to be able to replace the placeholder variables by simply typing over.
How to reproduce it (as minimally and precisely as possible):
"testsnippet": {
"prefix": "test",
"body": ["console.log('${1:test}'); ${1:test}"],
"description": "test snippet"
}
In new file type "test" and expand the snippet.
All snippets without duplicate tabstops (so ${2:test} for example as the second tabstop) work properly.
Environment:
Macbook pro, macOS Sierra,
Having the same issue with my Arch machine. Does it have anything to do with how the multicursor is implemented?
I'm experiencing the same issue with snippets that use more than one of the same placeholder as @pocorschi describes.
Without the Vim extension enabled, I can expand a snippet and immediately begin typing to replace multiple placeholders at once.
With Vim enabled, when I expand the snippet and begin typing, the characters are added after the placeholders instead of overwriting the placeholders as expected. Note that this bug only occurs when there is more than one of the same placeholder in a single snippet. Snippets without duplicate placeholders work as expected.
You can kind of work around this (on mac at least) by doing Alt+Delete before starting to type.
@runningskull Thanks, that's very helpful. And it maintains the tab order to move on to the next tabstop after editing. Still hoping to see the actual issue resolved, though.
on Windows just Delete seems to be working for me. Thanks for giving me a clue @runningskull ... I was thrashing trying to figure out how to use react snippets with vscodevim. Agreed it is not intuitive and hopefully will be fixed.
Most helpful comment
You can kind of work around this (on mac at least) by doing
Alt+Deletebefore starting to type.