VSCodeVim / Vim

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

Jumping to Previous Position After Pressing a Key #9195

Open Bear-Frost opened 1 month ago

Bear-Frost commented 1 month ago

Describe the bug When searching for a symbol in VS Code, after finding the symbol and navigating to it, pressing any key on the keyboard causes the cursor to jump back to its previous position.

To Reproduce Steps to reproduce the behavior:

  1. Toggle the search symbol in VS code ( Ctrl + Shift + o ) or (Ctrl + p ) and then type "@"
  2. start searching for a symbol that you want to go to
  3. click the symbol or press enter
  4. start pressing any key

Expected behavior After navigating to the symbol I want to go to, the cursor should not jump back to its previous position after pressing any key.

Environment

Additional context This issue is not limited to searching for a symbol. If I also search for a word by pressing (Ctrl + F) and then navigate to that word, pressing any key causes the cursor to jump back to its previous position. This bug does not always occur, sometimes it doesn’t happen, and I’m still unsure what triggers it.

xiangfu1003 commented 3 weeks ago

I have the same issue, performance varies in different files, some files must appear, while others do not have this issue。 hope this problem can be resolved soon

zxch3n commented 3 weeks ago

gd is used to go to the definition in my config. After press i to enter the insert mode, it jumps back to the previous position.

https://github.com/user-attachments/assets/3deba5bf-2d0a-4698-8832-52f528837fa3

sguillia commented 1 week ago

This bug exists for more than a year and was reported here: https://github.com/microsoft/vscode/issues/177598

But it was closed after being identified as related to VSCodeVim.

If there are any pointers or guidance on how to address this, please let me know—I'm happy to contribute if I'm able.

This bug annoys me every single day.