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 724420 - SearchContext: add has_wrapped_around out parameters
SearchContext: add has_wrapped_around out parameters
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: General
unspecified
Other All
: Normal enhancement
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks: 720824
 
 
Reported: 2014-02-15 12:50 UTC by Sébastien Wilmet
Modified: 2016-07-21 19:50 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sébastien Wilmet 2014-02-15 12:50:18 UTC
With the forward() and backward() functions, it is currently not easily possible to know if the search has wrapped around.

With retrospection, I think the best is to add has_wrapped_around out parameters to these functions. But it is an API break, so we must wait GtkSourceView 4.0.

In the meantime, there are two ways to know if the search has wrapped around:
- compare the occurrence positions (if it goes from "20 of 20" to "1 of 20", the search has wrapped around).
- compare the 'iter' (where to begin the search) with the returned 'match_start' and 'match_end'.
Comment 1 Sébastien Wilmet 2016-06-04 12:52:59 UTC
We don't need to wait GtkSourceView 4, we can create new functions and deprecate the previous ones.

For example with the names forward2() and backward2(), like the Linux kernel does for some syscalls.
Comment 2 Sébastien Wilmet 2016-06-11 12:43:56 UTC
Done!