- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
Description
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:
- Toggle the search symbol in VS code ( Ctrl + Shift + o ) or (Ctrl + p ) and then type "@"
- start searching for a symbol that you want to go to
- click the symbol or press enter
- 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
- Extension (VsCodeVim) version: v1.27.3
- VSCode version: 1.92.1
- OS: Windows 10 ( Windows_NT x64 10.0.19045)
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.
zmsy, sguillia, qazxcdswe123, jpsyx, beantowel and 3 more
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
xiangfu1003 commentedon Aug 17, 2024
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
workbench.action.gotoSymbol
doesn't move cursor #9160zxch3n commentedon Aug 18, 2024
gd
is used to go to the definition in my config. After pressi
to enter the insert mode, it jumps back to the previous position.CleanShot.2024-08-18.at.20.16.18.mp4
sguillia commentedon Sep 4, 2024
This bug exists for more than a year and was reported here: microsoft/vscode#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.
qazxcdswe123 commentedon Sep 30, 2024
This is because
<C-o>
uses custom jump list and track jump(goto) command that is issued by vim only. So goto issued by mouse click is not tracked.To fix this simply add this to settings.json
wolf0403 commentedon Oct 20, 2024
Hi @qazxcdswe123 I'm slightly confused about where
<C-o>
come into play.I'm having this issue with "Go to Definition" (F12) followed by vim cursor moving command (h/j/k/l)
It feels like cursor jumping from VSCode commands are not tracked by VSCodeVim - is it possible to have VSCodeVim somehow find where currently cursor is, in some circumstances, before moving cursors?
qazxcdswe123 commentedon Oct 21, 2024
C-o
wont jump back to the correct locationAs of your problem, I have no idea :(
yuanx749 commentedon Nov 5, 2024
I have met the same issue at times, but it seems to work fine now, except in visual mode.
beantowel commentedon Dec 26, 2024
In my "vim.handleKeys" setting, "<C-o>" is disabled, but the problem still rises
itai-shmueli commentedon Feb 4, 2025
Experiencing the same issue. After jumping to definition, moving the cursor takes me back to previous location.
I will say however, that it only started happening recently, and not in august as the original reporter.
softmare commentedon Apr 28, 2025
Dear who still suffering from this bug.
After I changed vim extension version to 1.28.1 (from 1.29.0) this issue is solved.
joeytwiddle commentedon May 8, 2025
Note: I get this only if the definition is in the same file as the original position. If the jump crosses files, then I don't get this issue.
But I don't always get it. I'm not sure what makes it sometimes happen and sometimes not.
Does anyone know a workaround, i.e. a key I can press to get VSCodeVim to register VSCode's current cursor position? At present, I have to reach for the mouse. 🐁
q8f13 commentedon Aug 12, 2025
this issue exist for more than 2 years at least, not only ctrl - i/o would trigger it, just normal goToDefinition sometimes can wake this issue up.
i've get used to reload the whole editor as a reflection op