Vscode: Find in Selection expands to whole line

Created on 28 Aug 2019  路  7Comments  路  Source: microsoft/vscode

  • VSCode Version: 1.37.1
  • OS Version: Windows 10

Steps to Reproduce:

  1. Select text multiline (start of middle of line through end of middle of line)
  2. Do a find and replace on selection only

Expected Output:

The text in only the selection gets replaced

Actual Output:

The text in the selection is replaced along with the rest of the line outside of the selection.

Replace outside of selection

editor-find feature-request

Most helpful comment

Looked into this again. This is as expected and designed this way.

If so, shouldn't be current Find in selection renamed to Find in selected lines, or something like that? This issue clearly illustrates it is quite misleading.

Find in selection tooltip bubble

Correct label describing current intended behavior should probably be Set search range to whole lines containing primary selection and discard all selections if there is at least one search match.

All 7 comments

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

Looked into this again. This is as expected and designed this way.

Looked into this again. This is as expected and designed this way.

If so, shouldn't be current Find in selection renamed to Find in selected lines, or something like that? This issue clearly illustrates it is quite misleading.

Find in selection tooltip bubble

Correct label describing current intended behavior should probably be Set search range to whole lines containing primary selection and discard all selections if there is at least one search match.

This issue seems to be either fixed or intended behavior, but I don't understand it at all. When I do this:

  1. In an code file, select a code section, hit ctrl-h,
  2. Type something to be replaced,
  3. Enable the selection button,
  4. Perform the selection.

Still everything outside the selection gets replaced as well. This is either intended behavior or not a bug?? How then should I limit my replacement to the selection?
VSC replacement

I also have this issue, selecting a portion and clicking "replace all" replaces all instances in my file.

image

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!


:slightly_smiling_face: This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

villiv picture villiv  路  3Comments

VitorLuizC picture VitorLuizC  路  3Comments

curtw picture curtw  路  3Comments

DovydasNavickas picture DovydasNavickas  路  3Comments

sirius1024 picture sirius1024  路  3Comments