GNOME Bugzilla – Bug 742550
Search: search in priority the visible region on the screen doesn't always work
Last modified: 2016-08-10 17:09:55 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.
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
Instead of GtkSourceBufferExtension, GtkSourceBufferInternal might be a better name.
Fixed: commit 1657f7998a31a0a220001001710c598023b5c582 commit a89291ce4245659af19414216c6423d2aa317b07