This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 219536

Summary: Can't restrict search to selection from search bar
Product: editor Reporter: _gt
Component: SearchAssignee: Milutin Kristofic <mkristofic>
Status: RESOLVED WONTFIX    
Severity: normal CC: jlilley, rasamassen, uireviews, ulfzibis
Priority: P3 Keywords: PLAN
Version: 7.2   
Hardware: PC   
OS: Windows 7   
Issue Type: ENHANCEMENT Exception Reporter:

Description _gt 2012-10-04 15:49:50 UTC
Please add search selection checkbox to search bar
Comment 1 Milutin Kristofic 2013-02-04 17:04:44 UTC
There is a plan to make better search UI in netbeans 8.0. The most important is include selection search button in this UI.
Comment 2 ulfzibis 2013-02-22 00:00:20 UTC
I'm not sure, if I correctly understand this bug.
Do you mean, if one has marked some text in the editor and wants to search for that without using Crtl+F ?
By pure chance I thought about this use case yesterday and another possible solution came to my mind:
- mark text
- click on the search field combo-box arrow
- fill the top most combo-box entry with the marked text, but leave the current pattern selected
-> User can select the upper entry for next search
Comment 3 Milutin Kristofic 2013-11-19 14:27:56 UTC
*** Bug 238515 has been marked as a duplicate of this bug. ***
Comment 4 Milutin Kristofic 2015-09-04 12:23:51 UTC
*** Bug 251167 has been marked as a duplicate of this bug. ***
Comment 5 jlilley 2015-09-04 13:09:56 UTC
Because my bug report was marked as duplicate of this one, I wanted to include my use case here:
This may be a duplicate of 175550, but that refers to a different NetBeans major version and very different UI for search/replace.

For example, I have a list of strings:
"abc",
"def",
"ghi",
...
I want to turn this into:
set.add("abc");
set.add("def");
set.add("ghi");

So I select, hit CTRL-H, enter
  Find What: ", 
  Replace With: ");
Hit CTRL-P to replace.
Then I hit CTRL-H again, replace " with set.add("
It replaces the entire file because selection was lost.
Please retain selection after CTRL-P in replacement.
Yes, I know I could do this with a regex.  But not all cases are so simple and this would be broadly applicable.
Comment 6 jlilley 2015-09-04 13:12:45 UTC
I can see from comments that this is supported, however the steps are easy to miss:
    Make selection
    Hit CTRL-H
    Find What: ", 
    Replace With: ");
    Hit CTRL-P to replace.
    DO NOT hit CTRL-H again
    With mouse, click on "Find what" OR type ALT-I to select

Perhaps a "doc fix" is the right solution?
Comment 7 Martin Balin 2016-07-07 07:26:16 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss