After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 421800 - Search/replace in all open files
Search/replace in all open files
Status: RESOLVED OBSOLETE
Product: gedit
Classification: Applications
Component: search and replace
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: Gedit maintainers
Gedit maintainers
: 171926 607202 607203 624409 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-03-23 08:53 UTC by Yannig MARCHEGAY
Modified: 2020-11-24 10:00 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
Patch to add a "Search in open documents" option. (17.57 KB, patch)
2009-02-07 21:21 UTC, Mateus César Gröess
none Details | Review
Merge do_find and do_find_again functions (4.46 KB, patch)
2009-02-08 02:37 UTC, Mateus César Gröess
none Details | Review
Fix flags usage, merge do_find and do_replace_all search methods. (7.67 KB, patch)
2009-02-18 01:43 UTC, Mateus César Gröess
none Details | Review
Do the indentation mentioned before. (1.05 KB, patch)
2009-02-18 01:53 UTC, Mateus César Gröess
none Details | Review
Full patch. (20.30 KB, patch)
2009-02-19 02:10 UTC, Mateus César Gröess
none Details | Review

Description Yannig MARCHEGAY 2007-03-23 08:53:46 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
Comment 1 Rafael Gattringer 2007-09-23 16:48:02 UTC
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
Comment 2 Yannig MARCHEGAY 2007-09-24 04:57:11 UTC
I'll try, thanks :-)
Comment 3 Yannig MARCHEGAY 2007-09-27 20:35:40 UTC
Done. I hope developpers will like this enhancement :-) (I'm just a translator, I cannot do it :P).
Comment 4 Yannig MARCHEGAY 2008-01-31 08:06:01 UTC
Any news?
Comment 5 Mateus César Gröess 2009-02-07 21:21:57 UTC
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.
Comment 6 Mateus César Gröess 2009-02-08 02:37:04 UTC
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.
Comment 7 Mateus César Gröess 2009-02-18 01:43:45 UTC
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.
Comment 8 Mateus César Gröess 2009-02-18 01:53:11 UTC
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.
Comment 9 jessevdk@gmail.com 2009-02-18 08:21:54 UTC
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.
Comment 10 Mateus César Gröess 2009-02-19 02:10:39 UTC
Created attachment 129029 [details] [review]
Full patch.

Ok, here is the full patch.
Comment 11 Mateus César Gröess 2009-07-06 01:30:21 UTC
Any chance of this feature be included for 2.28?
Comment 12 André Klapper 2010-03-03 22:52:59 UTC
*** Bug 171926 has been marked as a duplicate of this bug. ***
Comment 13 André Klapper 2010-03-03 22:53:55 UTC
*** Bug 607203 has been marked as a duplicate of this bug. ***
Comment 14 Ignacio Casal Quinteiro (nacho) 2011-03-02 23:14:09 UTC
*** Bug 607202 has been marked as a duplicate of this bug. ***
Comment 15 Ignacio Casal Quinteiro (nacho) 2013-03-29 15:14:42 UTC
*** Bug 624409 has been marked as a duplicate of this bug. ***
Comment 16 Sébastien Wilmet 2020-11-24 10:00:55 UTC
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.