How to search selected text only? Follow
Hi, before the search bar it seems to me we used to be able to search only on selected text via the search dialog.
I can't seem to find this feature anymore and if it doesn't exist I'd like to see it added back in.
I found such a feature useful for my workflow.
Can someone confirm if this feature is available in 9.x or not.
Please sign in to leave a comment.
Here is a workaround:
ctrl+r - Replace Text dialog
Scope: Selected text
Hi Find button, ant then each time hit 'Skip' button to not do replacing but searching
F3 and ctrl+F3 will continue searching/replacing after you close this dialog
"Selection" is one of the options in the "Custom:" pop-up, when you select its (Custom's) radio button in the "Scope" section of the "Find in Path" dialog.
Good eye, not exactly a logical step to have "Selection" in "Search in Path" but hey.
It doesn't seem to be working completely however, I select the text, bring up the dialog box, fill in my values carefuly, select custom->Selection then I get "No occurences of 'My Text' found in Selection" even though it should match.
Attaching screen shot.
Thanks for the feedback.
Turns out that's not the current text selection, it's something related to custom scopes.
Sorry for the misdirection.
So it's 2019 and this is still the case. I guess we just won't ever get "Find in Selection"?
Lol okay IntelliJ just got it (https://youtrack.jetbrains.com/issue/IDEA-146832?_ga=2.106183296.2055332948.1569356888-1516195955.1554743996).
Here's the link to my answer on SO
Unlike regular search, search in selection currently doesn't unfold the collapsed pieces of text to show matching text; rather it just should a line indicator before the collapsed piece indicating that a match was found inside it. Hopefully `JetBrains` will fix it overtime