VSCodeVim / Vim

:star: Vim for Visual Studio Code
http://aka.ms/vscodevim
MIT License
14.01k stars 1.32k forks source link

Vim unexpectedly turns into visual mode for adjacent snippet placeholders #9236

Open adong660 opened 3 months ago

adong660 commented 3 months ago

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