GNOME Bugzilla – Bug 421800
Search/replace in all open files
Last modified: 2020-11-24 10:00:55 UTC
Hello, Would it be possible to have a feature for searching and replacing text in all open files? It would be much easier for batch-processing some files. Thanks, Yannig MARCHEGAY
Hi there, a "Replace in all open files" option is currently the feature I miss most in gedit. So I would like to vote for this RFE. ;) Yannig, is it possible for you to change the severity of this bug to "Enhancement"? Regards, Rafael
I'll try, thanks :-)
Done. I hope developpers will like this enhancement :-) (I'm just a translator, I cannot do it :P).
Any news?
Created attachment 128191 [details] [review] Patch to add a "Search in open documents" option. Preliminary patch, for testing. Currently, no problem found with my tests, but would be good if someone else could confirm if it is ok. Unfortunately it is for Gedit 2.24.2, what I have installed. I don't know how compatible it is with other versions.
Created attachment 128204 [details] [review] Merge do_find and do_find_again functions This is a patch to apply after the first one. It merges "do_find" and "do_find_again" functions, because they turned to be almost the same. Also, a comment is replaced by a better one and an unused flag is removed from "do_replace" function. Again, Gedit version is 2.24.2. There is a possibility of little optimization, moving the call to g_object_set_data, below the comment changed by this patch, to the "if {}" inside "if (found)". This will set the search data only for the document where the search finished, which will work right for next "Find Next/Previous", but I don't felt comfortable when switched to other document, opened the "Find" dialog and don't saw the last options I used. Maybe the current solution is still the most logical one, because all documents searched will preserve the same search data.
Created attachment 128937 [details] [review] Fix flags usage, merge do_find and do_replace_all search methods. This is a patch to apply after the first and second ones. It modifies the search function and changes "do_replace_all" to make use of it, so both "do_find" and "do_replace_all" functions have the same search behavior. I discovered also an issue with the values assigned by the new "last_search_data_set" function, because of the bit-fields of _LastSearchData struct. I fixed the problem changing the fields from gint to guint. I found this webpage that seems talking about the same issue: http://blogs.sun.com/chrisg/entry/those_bit_fields_should_have. This patch will be followed by another that just changes indentation, necessary because of these changes, but not included here to make the diff file more simple to follow.
Created attachment 128938 [details] [review] Do the indentation mentioned before. This is gedit-2.24.2-merge_replace_2_2.diff. The previous should have been named gedit-2.24.2-merge_replace_1_2.diff, but ended being wrongly named gedit-2.24.2-merge_replace_1_1.diff.
Could you maybe instead of creating superseding patches, create new, full patches and when attaching them to bugzilla, mark previous patches obsolete? That makes it much easier to review. I think this feature would be great to go into 2.27 as soon as release 2.26.
Created attachment 129029 [details] [review] Full patch. Ok, here is the full patch.
Any chance of this feature be included for 2.28?
*** Bug 171926 has been marked as a duplicate of this bug. ***
*** Bug 607203 has been marked as a duplicate of this bug. ***
*** Bug 607202 has been marked as a duplicate of this bug. ***
*** Bug 624409 has been marked as a duplicate of this bug. ***
Mass-closing of all gedit bugzilla tickets. Special "code" to find again all those gedit bugzilla tickets that were open before the mass-closing: 2bfe1b0590a78457e1f1a6a90fb975f5878cb60064ccfe1d7db76ca0da52f0f3 By searching the above sha256sum in bugzilla, the gedit contributors can find again the tickets. We may be interested to do so when we work on a specific area of the code, to at least know the known problems and possible enhancements. We do this mass-closing because bugzilla.gnome.org is being replaced by gitlab.gnome.org.