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 134674 - Regular expression searches
Regular expression searches
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: General
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
: 369269 (view as bug list)
Depends on: 689794
Blocks: 103751 348754
 
 
Reported: 2004-02-17 21:54 UTC by Gustavo Giráldez
Modified: 2013-08-19 14:16 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Gustavo Giráldez 2004-02-17 21:54:30 UTC
GtkSourceView should support regular expression searches natively through
some GtkSourceIter API.
Comment 1 Paolo Maggi 2004-02-18 10:40:09 UTC
WOW... Any idea on how to implement it in an efficient way, i.e.
without putting the entire documnt in a buffer?
Comment 2 Gustavo Giráldez 2004-02-18 21:09:26 UTC
Well, since we depend on GNU regexes, we can take advantage of
re_search_2 which searches on split data, and perform the search on
small chunks.
Comment 3 Yevgen Muntyan 2008-08-03 00:11:04 UTC
*** Bug 369269 has been marked as a duplicate of this bug. ***
Comment 4 Sébastien Wilmet 2013-04-22 12:50:41 UTC
With GRegex, g_match_info_is_partial_match() can be useful.

The text of the buffer can be retrieved chunks by chunks with gtk_text_buffer_get_text(). If there is a full match, we return the corresponding GtkTextIter's. If there is a partial match, we take a bigger chunk.

For the search and replace feature, the performances should be OK.
Comment 5 Sébastien Wilmet 2013-06-22 07:41:56 UTC
Move GtkTextView -> GtkSourceView.
Comment 6 Sébastien Wilmet 2013-06-22 20:17:08 UTC
It will be easier to implement in gsv, if GTK_TEXT_SEARCH_VISIBLE_ONLY and GTK_TEXT_SEARCH_TEXT_ONLY are always enabled. In gtk+, we must support all flags combinations.
Comment 7 Sébastien Wilmet 2013-08-19 14:16:34 UTC
Implemented in GtkSourceView.