VSCodeVim / Vim

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

Ignoring slipped selection after scrolling down extremely fast #9142

Open Sheepolution opened 1 month ago

Sheepolution commented 1 month ago

Describe the bug When scrolling down a file extremely fast the extension will go into a state where searching will give a ignoring slipped selection warning, and the cursor will jump back to its original position after pressing escape twice.

To Reproduce

  1. Add a mapping to move down fast. For example:
    nnoremap J 10j

    Though I managed to trigger this with 1j as well. Simply using j on the other hand does not trigger it.

  2. Go to a file that does not fit on a single page. Two screens long should be enough to trigger the bug.
  3. Scroll down by holding down the mapped key. Note that I have my Windows modified for rapid repeated keys. I'm not sure if that is necessary to trigger this, or if the normal repeated key interval will suffice.
  4. Press Ctrl + F for search.
  5. Search anything away from where your cursor is currently at.
  6. Press escape twice.
  7. The cursor jumps back to its old position.

When you search a warning triggers: Ignoring slipped selection: [49, 51; 49, 52] appear.

Expected behavior When pressing escape twice I expect my cursor to stay in the position where it was placed as a result of searching.

Screenshots Searching for b and then pressing escape twice. jump_back_bug

Environment (please complete the following information):

Additional context This is a terrible type of bug, because it makes me distrust my editor. Every time I press escape after a search I need to hope that it will not jump back. If anyone has a quick fix for me, that would also be great.

thequailman commented 15 hours ago

I have this too, specifically when doing jump to errors/problems. The screen will suddenly jump to the top of the file or change some random line that isn't my current one. The only fix I have found is to close VSCode and reopen it.