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 238677 - "Results are outdated" - can't search & replace after spending long time on making selections
Summary: "Results are outdated" - can't search & replace after spending long time on m...
Status: RESOLVED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Search (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Jaroslav Havlin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-21 21:45 UTC by lemon_juice
Modified: 2013-12-07 21:23 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lemon_juice 2013-11-21 21:45:33 UTC
I have come across a very annoying problem when doing search and replace in multiple files - I have marked it as DEFECT because due to it I have actually lost many long minutes of my work and had to redo it:

Steps to Reproduce:

Run the "Replace..." command on a folder and a list of files appears in the "Search Results" pane where my phrase has been found giving me the option for each occurrence to be replaced or not. Let's say the list is pretty long and I have spent quite a lot of time reviewing each occurrence and checking/unchecking as necessary. In the mean time I review and edit a few files in Netbeans and I happen to make a small change in a file that is in the search results pane - be it intentionally or by mistake. After I do it the replace button changes to a greyed out button "Results are outdated" and all my work in making the selections is lost!

Actual Results:

After editing a file in the search results pane I lose the ability to apply the replacements to any of the files that have been found. This means I have to redo all my work and if the results list is long it means redoing a lot of work.

Expected Results:

While it is understandable that it's difficult to apply replacements to a file that has been changed I still should be able to apply the replacements to all other files that have not been changed. Some solutions that come to my mind:

1. If I change a file in the replacement list I only get a warning that some files will be skipped in the replacement process because they have been changed. But the replace button should still be active and should do the replacements on all the other files. The files to be ignored could appear in red or grey - but they already get the triangle icon so this is not really essential.

2. Netbeans could detect when I change a file back to its original form and re-enable it for the replacement process. So if I make a change to a file and the replacement is disabled and then I change the contents of the file to what was there originally (for example, by using Undo) then Netbeans should allow replacing it.

Something should be done to prevent losing all the selections in the search results pane by inadvertent change to some files.
Comment 1 Jaroslav Havlin 2013-11-27 07:47:30 UTC
I agree, this should be fixed.
I'll evaluate the solutions that you suggested.
Thank you very much for reporting.
Comment 2 Jaroslav Havlin 2013-11-29 13:36:53 UTC
http://hg.netbeans.org/core-main/rev/33acb030e1a1
Fixed.

Now the replace operation can be performed if no outdated file is selected.
I'm also considering adding a "Refresh" action to outdated files.
Comment 3 Jaroslav Havlin 2013-12-03 13:16:51 UTC
> I'm also considering adding a "Refresh" action to outdated files.
http://hg.netbeans.org/core-main/rev/e4a3c8100d7c

Now, if you have a lot of files in search results and some of them become invalid, you can simply uncheck them and the "Replace" button will be enabled.
You can also right-click individual outdated files and select "Refresh" action.

Please verify that this solution fixes the problem appropriately for your use cases.
Thank you.
Comment 4 lemon_juice 2013-12-07 21:23:24 UTC
I have tested it and it works very well - I also thought about the refresh command and you've done exactly was missing and it's really useful. Thank you for implementing this quickly!