microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.61k stars 28.66k forks source link

Find cancels the selection #192388

Open xanatos opened 1 year ago

xanatos commented 1 year ago

Find cancels the current selection. I hate it :-)

Steps to Reproduce:

  1. Open a document
  2. Select a block of text
  3. Press CTRL-F
  4. Write a word to search that is present in the document
  5. The original selection is cancelled. The searched word is selected.

Including a small video: https://github.com/microsoft/vscode/assets/821344/fb0bb0d0-ebb0-4835-9c22-36ea8a7b801c

If you do the same in Visual Studio, the "old" selection will be saved and become a "lighter colored" selection, like with VS Code when you use the Find in Selection button.

The problem here is that the Find in Selection button is on the RIGHT of the textbox for finding text, so the "natural" way of working (left-to-right) is to fill the textbox for finding the text and then clicking on the Find in Selection, but if you try to do it in VS Code, the selection will be cancelled when you digit a single character in the textbox.

amunger commented 9 months ago

interesting, if you set "editor.find.autoFindInSelection": "multiline", this doesn't occur. And that might be what you would prefer anyway.