How to search selected text only?
已回答
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.
Thank you.
Martin
请先登录再写评论。
Martin,
"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.
Randall Schulz
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.
Any tips?
Thanks for the feedback.
Attachment(s):
test.png
Turns out that's not the current text selection, it's something related to custom scopes.
Sorry for the misdirection.
Randall Schulz
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
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).
I'm using
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