Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Find in Selection not enabled by default #12109

Closed
ghost opened this issue Sep 15, 2016 · 23 comments
Closed

Make Find in Selection not enabled by default #12109

ghost opened this issue Sep 15, 2016 · 23 comments
Assignees
Labels
editor-find Editor find operations
Milestone

Comments

@ghost
Copy link

ghost commented Sep 15, 2016

  • VSCode Version: Code 1.5.2 (66f37fd, 2016-09-12T13:05:12.065Z)
  • OS Version: Darwin x64 15.6.0

Steps to Reproduce:

@ramya-rao-a
Copy link
Contributor

@Turash Can you provide more details on which search are you referring to?

  • Search in a file
  • Search across files
  • Quick open
  • Find all references

There are different search features

@bpasero
Copy link
Member

bpasero commented Sep 16, 2016

Needs more info.

@bpasero bpasero added the info-needed Issue requires more information from poster label Sep 16, 2016
@ghost
Copy link
Author

ghost commented Sep 16, 2016

Hi, It does not happen every time. Sometimes. I will paste right away when I experience.

@ghost
Copy link
Author

ghost commented Sep 16, 2016

test

@chrmarti
Copy link
Contributor

The screenshot shows a text search within a file. The file shows several occurrences of the text "marker" while the search box searching for "marking" says "No results".

@Turash:

  • Does the problem always occur with this file and the search for "marker"?
  • Does the problem go away when you close and reopen the search box?
  • If not, does the problem go away when you close and reopen the editor tab?
  • If not, does the problem go away when you restart VS Code?

@chrmarti chrmarti assigned alexdima and unassigned chrmarti Sep 19, 2016
@alexdima
Copy link
Member

Those highlights are not coming from the find widget (they would show in the overview ruler).

@Turash Can you please provide exact reproducible steps, we would love to get to the bottom of this issue.

@chrmarti
Copy link
Contributor

@alexandrudima Wouldn't you expect the find widget to show the number of results instead of "No results"?

@ghost
Copy link
Author

ghost commented Sep 20, 2016

Hi,
I use the latest one for mac. I can never find the correct text at some point. I do not know if its for my cache memory. Should I sent you over my files or?

@alexdima
Copy link
Member

@chrmarti Yes, there is something wrong (an event missing or ignored perhaps?) where the find widget in this case does not realize it gets a new model or something and does not research -- hence the lack of 'x of y' matches, the lack of find widget decorations, etc.

@Turash, sure we can start with the file that causes this issue, but is this happening all the time for you? As in, you open this specific file and cmd+f is never able to find anything in this file? Or is this happening after some certain steps, as in, you open a file, find in a file, then switch to a different file, etc.

I would love any hints on how we can reproduce, thank you.

@ghost
Copy link
Author

ghost commented Sep 20, 2016

Hi @alexandrudima
It happens after certain time. And no way back, but restart the ide.

@alexdima
Copy link
Member

@Turash did you install extensions that modify and patch our sources (e.g. vscode-icons)?

@roblourens
Copy link
Member

In case you guys didn't notice, 'find in selection' is selected in that screenshot. So there might be some selected text offscreen. I tend to trigger this on accident all the time. @Turash, next time can you try clicking that button in the find widget to the right of the arrows?

@alexdima
Copy link
Member

@roblourens That is it! It is the find in selection.

@bgashler1 Should we emphasize somehow the find in selection toggle when there are no results and the toggle is on? The idea would be to bring attention to that toggle such that if you click it, you might get results in other areas of the file.

image

@alexdima alexdima added this to the Backlog milestone Sep 26, 2016
@bgashler1
Copy link
Contributor

bgashler1 commented Sep 26, 2016

I've experienced this problem as well. It could definitely be improved. Whenever I have text selected that's on screen, it eventually sort of becomes clear to me what's going wrong. But if the selection is off screen this can be quite confusing.

I wonder if having this button enabled by default when there is a selection is the right thing to do. What is the reasoning behind having it automatically search within the selection only. I think it's pretty easy to not know that this will happen by default if there is a selection. Both Sublime and Atom require you to take an extra step to search only within a selection.

If we do leave this enabled by default we should make sure there is a good reason for doing so, and we should explore ways to alert users that this feature is enabled so they can understand why they're not getting what they may expect in a situation like above. Perhaps a different color of the "No results" and/or rename it to "No results in selection." Or perhaps the button that is enabled flashes or shakes. Or perhaps a dismissible overlay on the first instance of this problem that says "You are searching only within a selection. Turn this off to search the whole document"

@roblourens
Copy link
Member

@alexandrudima @bgashler1 @chrmarti Could we make Find in Selection not enabled by default for October? One of my pet peeves.

@chrmarti
Copy link
Contributor

It is enabled when selecting multiple lines in the editor before opening the find widget. We could turn off that behavior.

@roblourens
Copy link
Member

Right, that's what I mean

@bgashler1 bgashler1 added editor editor-find Editor find operations and removed info-needed Issue requires more information from poster labels Oct 12, 2016
@bgashler1 bgashler1 modified the milestones: October 2016, Backlog Oct 12, 2016
@Bill-Stewart
Copy link

I think it makes sense not to enable the "Find in selection" option by default, especially as other editors have established this as a behavioral precedent. The current behavior is inconsistent (it only enables by default if the selection contains a newline). I also think the message should say "No results in selection" to make this more explicit.

@roblourens roblourens assigned roblourens and unassigned alexdima Oct 18, 2016
@roblourens roblourens changed the title Slow search: Hi, your seach for code is very unreliable. I am sure there is much room for improvement- Thanks Make Find in Selection not enabled by default Oct 18, 2016
@dvlsg
Copy link

dvlsg commented Nov 7, 2016

This change definitely threw me off, since I am used to selecting multiple lines, pressing ctrl+f, searching, pressing shift+enter, then typing my replacements intended for the current selection.

Now that "find in selection" is no longer enabled by default when multiple lines are selected, I have to take my hands off the keyboard to go click that button, usually after I realize I just replaced way more than I originally intended.

I can certainly understand how the reverse could be irritating as well, though. Is there a currently available way to re-enable "find in selection" by default whenever more than one line is selected (config / setting), so we can choose for ourselves? Something like auto_find_in_selection in sublime text.

@bgashler1
Copy link
Contributor

@dvlsg I don't think we have a setting for this. Could you create another issue requesting this (also reference this issue number in it)?

@Bill-Stewart
Copy link

My opinion: "Find in selection" should be enabled by default if there is any selection at all (multi-line or not). If "find in selection" is enabled by default only for certain kinds of selections, this seems arbitrary and inconsistent. For users that don't like "find in selection" to be enabled by default when there is a selection, it makes sense to have an option to disable it.

@dvlsg
Copy link

dvlsg commented Nov 7, 2016

@bgashler1 I actually ran across #8843 after posting -- it's not quite the same, but that issue / request would be sufficient for me. I'm really just looking for a way to fire up the find-in-selection using just my keyboard.

If you think there might be sufficient desire for the explicit setting as well as the direct shortcut referenced in #8843, I certainly can take the time to create an issue request for that.

@bgashler1
Copy link
Contributor

bgashler1 commented Nov 8, 2016

@Bill-Stewart we needed to remove the default find in selection behavior due to it being easy to misunderstand what was going on when no results were showing up for some users.

Two potential solutions we will consider are adding a setting to enable finding within selections by default or a new command as proposed in #8843 that you could rebind the keyboard shortcut for Find/Replace to that tries to find in selection by default.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor-find Editor find operations
Projects
None yet
Development

No branches or pull requests

8 participants