[gtksourceview/wip/chergert/vim: 47/363] fix $ motion




commit 12586c3f30c69fc1b54b904c02b65805cfae8b68
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]