Vim unexpectedly turns into visual mode for adjacent snippet placeholders
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.2k
- Forks
- 1.5k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 6
Description
After creating a snippet with several placeholders, my expected behavior is that, vim keeps in the insert mode, and the user inputs some letters in the first placeholder, and then presses the TAB key to go to the second to input, until all placeholders are filled. During this process, vim is always in the insert mode unless the user presses the ESC key. This holds for most cases so I think this should be the expected behavior.
However, if two placeholders in a snippet are directly adjacent, i.e. there's no other characters between them, when the user finishes filling the first placeholder, and presses TAB to go to the second, vim will unexpectedly go to the visual mode, selecting the second placeholder. If the second placeholder doesn't have another placeholder nested in it, pressing a c will deal with the case; otherwise, more key presses are necessary.
The attached MP4 video file shows the expected and unexpected behaviors mentioned above.
https://github.com/user-attachments/assets/8eaabd62-d968-4800-8a62-eae698107bfd
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with a snippet containing directly adjacent placeholders, following the attached video and the TAB navigation steps. Trace the snippet placeholder transition and Vim mode change; done means pressing TAB moves to the next placeholder while remaining in insert mode, without unexpectedly selecting it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100