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 742550 - Search: search in priority the visible region on the screen doesn't always work
Search: search in priority the visible region on the screen doesn't always work
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: General
git master
Other All
: Normal normal
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2015-01-07 20:32 UTC by Sébastien Wilmet
Modified: 2016-08-10 17:09 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sébastien Wilmet 2015-01-07 20:32:10 UTC
Is the high_priority_region always set? For example, if I type only one char in the search entry, but the visible region is at the end of the buffer.

The high_priority_region is set only when the GtkTextView draws something. If a tag is applied at the beginning of the buffer, no redraw is needed, so the high_priority_region isn't set.
Comment 1 Sébastien Wilmet 2016-06-17 10:37:45 UTC
A private signal ::start-search(buffer, search_context) could be created.
The view connects to that signal and calls _gtk_source_search_context_update_highlight() with [start,end] the visible region of the view.

To create a private signal, a GtkSourceBufferExtension private class could be created, to extend GtkSourceBuffer without subclassing it, the same way as GspellTextBuffer:
https://git.gnome.org/browse/gspell/tree/gspell/gspell-text-buffer.c?h=1.0.0#n154
Comment 2 Sébastien Wilmet 2016-08-07 15:53:11 UTC
Instead of GtkSourceBufferExtension, GtkSourceBufferInternal might be a better name.
Comment 3 Sébastien Wilmet 2016-08-10 17:09:55 UTC
Fixed:
commit 1657f7998a31a0a220001001710c598023b5c582
commit a89291ce4245659af19414216c6423d2aa317b07