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.
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.
I was playing with some ideas how to retain selection in replacebar. Problem is if I retain selection it is difficult to get rid of selection. This usecase : 1, I select text and press ctrl+h 2, I do search and replace in selected text 3, I want to do search and replace in whole document, so I press ctrl+h again to get rid of selection In your case you should not press ctrl+h, but you should continue working with current replacebar. But I know UI is sometimes confusing, people press ctrl+h by accident and are loosing selection. There are some plans to change UI in Task #219536 and Task #207532 . It is too late to do it to 8.1. *** This bug has been marked as a duplicate of bug 219536 ***