[gtksourceview/wip/regex-search] SearchContext: fix a bug with partial matches
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/regex-search] SearchContext: fix a bug with partial matches
- Date: Thu, 15 Aug 2013 16:52:16 +0000 (UTC)
commit 26e99bca3b36b33d6039ca7a024c635522b305a2
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]