[gtksourceview/wip/search] search: minor fixes



commit 177198a30362959c5d633d588d5fb9cf13cdca11
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Wed Jun 19 11:49:36 2013 +0200

    search: minor fixes

 gtksourceview/gtksourcesearch.c |   18 +++++++-----------
 1 files changed, 7 insertions(+), 11 deletions(-)
---
diff --git a/gtksourceview/gtksourcesearch.c b/gtksourceview/gtksourcesearch.c
index 2b761b2..2808c7b 100644
--- a/gtksourceview/gtksourcesearch.c
+++ b/gtksourceview/gtksourcesearch.c
@@ -141,8 +141,6 @@ update (GtkSourceSearch *search)
        GtkTextIter start;
        GtkTextIter end;
 
-       g_return_if_fail (GTK_SOURCE_IS_SEARCH (search));
-
        if (dispose_has_run (search))
        {
                return;
@@ -351,18 +349,16 @@ highlight_subregion (GtkSourceSearch *search,
 
        iter = *start;
 
+       if (gtk_text_iter_is_end (end))
+       {
+               end = NULL;
+       }
+
        do
        {
                GtkTextIter match_start;
                GtkTextIter match_end;
 
-               /* FIXME normally it is not needed.
-               if ((end != NULL) && gtk_text_iter_is_end (end))
-               {
-                       end = NULL;
-               }
-               */
-
                found = gtk_text_iter_forward_search (&iter,
                                                      search->priv->text,
                                                      search->priv->flags,
@@ -370,8 +366,6 @@ highlight_subregion (GtkSourceSearch *search,
                                                      &match_end,
                                                      end);
 
-               iter = match_end;
-
                if (found)
                {
                        gtk_text_buffer_apply_tag (search->priv->buffer,
@@ -380,6 +374,8 @@ highlight_subregion (GtkSourceSearch *search,
                                                   &match_end);
                }
 
+               iter = match_end;
+
        } while (found);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]