[gedit/wip/spell-checking] auto-spell: fix bug when adjusting iters at word boundaries



commit f8c74b805b8bfa123943044e25bcd91184902577
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Fri Jul 17 17:26:02 2015 +0200

    auto-spell: fix bug when adjusting iters at word boundaries
    
    gtk_text_iter_forward_word_end() returns FALSE if @start is moved to the
    end iter. If @start is at the end iter, we can anyway move to the
    previous word start, regardless of whether @start has moved or not.

 plugins/spell/gedit-automatic-spell-checker.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/plugins/spell/gedit-automatic-spell-checker.c b/plugins/spell/gedit-automatic-spell-checker.c
index edf5915..9507c5f 100644
--- a/plugins/spell/gedit-automatic-spell-checker.c
+++ b/plugins/spell/gedit-automatic-spell-checker.c
@@ -100,7 +100,8 @@ adjust_iters_at_word_boundaries (GtkTextIter *start,
                         * me must be in some spaces.
                         * Skip forward to the beginning of the next word.
                         */
-                       if (gtk_text_iter_forward_word_end (start))
+                       if (gtk_text_iter_forward_word_end (start) ||
+                           gtk_text_iter_is_end (start))
                        {
                                gtk_text_iter_backward_word_start (start);
                        }


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