Vim icon indicating copy to clipboard operation
Vim copied to clipboard

Navigating through the search panel makes the editor to move to visual mode

Open HSadeghein opened this issue 9 months ago • 4 comments

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:

  1. Search something in the search panel
  2. Click on one of the results
  3. 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

Image

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.29.0
  • VSCode version: 1.98.0
  • OS: Windows 11

Additional context

HSadeghein avatar Mar 07 '25 11:03 HSadeghein

+1 - This also seems to affect other panel lists like the Problems panel for example.

TomMalitz avatar Apr 03 '25 00:04 TomMalitz

+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.

bikubi avatar Sep 17 '25 06:09 bikubi

This also happens with find-in-file https://github.com/VSCodeVim/Vim/issues/8908

diminutivesloop avatar Oct 12 '25 01:10 diminutivesloop

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."

baz-sh avatar Nov 12 '25 12:11 baz-sh