[gtksourceview] SpaceDrawer: group loop breaks together



commit ffd90fb1408c6dc37eff49e5be81869dbf75cba6
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Mon Aug 15 22:35:22 2016 +0200

    SpaceDrawer: group loop breaks together
    
    This shouldn't change anything. It's just more logical to group breaks
    together before gtk_text_iter_forward_char().

 gtksourceview/gtksourcespacedrawer.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/gtksourceview/gtksourcespacedrawer.c b/gtksourceview/gtksourcespacedrawer.c
index d396382..2d165bf 100644
--- a/gtksourceview/gtksourcespacedrawer.c
+++ b/gtksourceview/gtksourcespacedrawer.c
@@ -658,7 +658,8 @@ _gtk_source_space_drawer_draw (GtkSourceSpaceDrawer *drawer,
                        draw_whitespace_at_iter (text_view, &iter, cr);
                }
 
-               if (gtk_text_iter_is_end (&iter))
+               if (gtk_text_iter_is_end (&iter) ||
+                   gtk_text_iter_compare (&iter, &end) >= 0)
                {
                        break;
                }
@@ -667,11 +668,6 @@ _gtk_source_space_drawer_draw (GtkSourceSpaceDrawer *drawer,
 
                if (gtk_text_iter_compare (&iter, &line_end) > 0)
                {
-                       if (gtk_text_iter_compare (&iter, &end) > 0)
-                       {
-                               break;
-                       }
-
                        /* Move to the first iter in the exposed area of the
                         * next line.
                         */


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