[gtksourceview] SearchContext: fix a bug with partial matches
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] SearchContext: fix a bug with partial matches
- Date: Mon, 19 Aug 2013 14:05:16 +0000 (UTC)
commit 4ff6b0c5bcf20e2d81d255679ce1ef1f051afe4b
Author: Sébastien Wilmet <swilmet gnome org>
Date: Thu Aug 15 18:49:50 2013 +0200
SearchContext: fix a bug with partial matches
A unit test will arrive soon.
gtksourceview/gtksourcesearchcontext.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/gtksourceview/gtksourcesearchcontext.c b/gtksourceview/gtksourcesearchcontext.c
index f2fd45c..9202905 100644
--- a/gtksourceview/gtksourcesearchcontext.c
+++ b/gtksourceview/gtksourcesearchcontext.c
@@ -1905,9 +1905,17 @@ regex_search_scan_segment (GtkSourceSearchContext *search,
if (g_match_info_is_partial_match (match_info))
{
- *stopped_at = iter;
segment_finished = FALSE;
+ if (gtk_text_iter_compare (segment_start, &iter) < 0)
+ {
+ *stopped_at = iter;
+ }
+ else
+ {
+ *stopped_at = *segment_start;
+ }
+
DEBUG ({
g_print ("partial match\n");
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]