microsoft / vscode

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

Basic usability issues with search & replace #128810

Closed peter-bertok closed 1 year ago

peter-bertok commented 3 years ago

Yes

Compared to other text editors or IDEs, Visual Studio Code's most basic search & replace functionality is broken in numerous ways:

When trying to make a replacement of a string, the selection is reset

  1. Select a block of code.
  2. Type in the text to replace -- this incorrectly resets the selection.
  3. Attempting to enable "find in selection" will set the selection to the first match, not the original selection.

Toggling any button resets selections if there's a matching string.

  1. Open the search & replace box, with a memorised search string in the find box.
  2. Press any button, such as "use regular expressions", "find in selection", etc...
  3. The selection will be reset (incorrectly).

(similarly, going back to a search item in the history also resets selections).

The history keyboard shortcut is the opposite of every other Windows IDE or text editor I just assumed VS Code has no search history because it doesn't respond to the standard keystroke that all other editors use. There is also no visual "prompt" indicating that a history exists unlike most other editors (which use combo boxes).

   VS Code:       UP
   Visual Studio: DOWN
   Notepad++:     DOWN
   TextPAD:       DOWN
   IntelliJ:      ALT+DOWN
   MS Word:       DOWN

There is no way to view search history The only method is to scroll back one at a time, unlike most other IDEs or text editors that use a combo box that can be opened and used to "pick" a specific entry.

Search in selection doesn't work consistently with "block select" Selecting a block of code using middle-click-drag doesn't interact well with search. I can't even get reproducible scenarios! Just trying this a few times in a row resulted in different effects, including two different selection highlights on top of each other, as well as a search indicating that "nothing matches" unexpectedly:

image

image

amunger commented 1 year ago

https://github.com/microsoft/vscode/issues/116827 covers selection issues https://github.com/microsoft/vscode/issues/23099 for requested search history it looks like find in selection for a block selection is working now