Navigating through the search panel makes the editor to move to visual mode
Describe the bug When I use the search panel in VSCode to find something and navigate through the results, the editor switches to visual mode, which is frustrating. This shift causes the Vim navigation commands <C-o> (go backward) and <C-i> (go forward) to stop working properly, as the editor remains stuck in visual mode.
To Reproduce Steps to reproduce the behavior:
- Search something in the search panel
- Click on one of the results
- Now you must be on the editor, move the cursor down or up, and then you can see it's in visual mode
Expected behavior Navigating through the result should not change the Vim mode to visual, it should keep it in normal mode
Screenshots
Environment (please complete the following information):
- Extension (VsCodeVim) version: 1.29.0
- VSCode version: 1.98.0
- OS: Windows 11
Additional context
+1 - This also seems to affect other panel lists like the Problems panel for example.
+1 maybe trivial, but this also happens when using F4/Shift-F4. Have to force myself to hit ESC often when I navigate through code.
This also happens with find-in-file https://github.com/VSCodeVim/Vim/issues/8908
Quick workaround: the root cause seems to be this line: https://github.com/VSCodeVim/Vim/blob/3f1ad54250c88020e7df3e1e326f4797363fdd8c/src/mode/modeHandler.ts#L268
If I comment that out, rebuild the extension, and install it locally, I can use VS Code’s Find and Command-P with % searches without it ever entering Visual mode.
I considered opening a PR, but several tests fail related to selection growth. That’s a feature I rarely use compared to grep-style search, so I’m OK living with the trade-off locally.
Ideally this can be fixed upstream so both behaviors work.
Note: pressing ESC after a search would be tolerable, but the bigger issue is that any tab with a match also switches to Visual mode, so you end up hitting ESC every time you change files."