[gtksourceview/wip/chergert/vim: 53/73] fix $ motion




commit dc96e32e38dd5e4dcf8dc889fd31d3f81d398f4c
Author: Christian Hergert <chergert redhat com>
Date:   Sat Oct 23 14:29:43 2021 -0700

    fix $ motion

 gtksourceview/vim/gtk-source-vim-motion.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/gtksourceview/vim/gtk-source-vim-motion.c b/gtksourceview/vim/gtk-source-vim-motion.c
index 072b5271..40fcdc4a 100644
--- a/gtksourceview/vim/gtk-source-vim-motion.c
+++ b/gtksourceview/vim/gtk-source-vim-motion.c
@@ -492,7 +492,13 @@ static gboolean
 motion_line_end (GtkTextIter   *iter,
                  GtkSourceView *view)
 {
-       return gtk_text_iter_forward_to_line_end (iter);
+       GtkTextIter begin = *iter;
+
+       gtk_text_iter_forward_to_line_end (iter);
+       if (!gtk_text_iter_starts_line (iter))
+               gtk_text_iter_backward_char (iter);
+
+       return !gtk_text_iter_equal (&begin, iter);
 }
 
 static gboolean


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