[gtksourceview/wip/chergert/vim: 121/363] fix end line motion




commit db98d660615ac561d19a78289c57a353177c5d36
Author: Christian Hergert <chergert redhat com>
Date:   Thu Oct 28 14:42:07 2021 -0700

    fix end line motion

 gtksourceview/vim/gtk-source-vim-motion.c | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)
---
diff --git a/gtksourceview/vim/gtk-source-vim-motion.c b/gtksourceview/vim/gtk-source-vim-motion.c
index feb16447..899c50fb 100644
--- a/gtksourceview/vim/gtk-source-vim-motion.c
+++ b/gtksourceview/vim/gtk-source-vim-motion.c
@@ -1462,23 +1462,9 @@ gtk_source_vim_motion_new_forward_char (void)
 }
 
 static gboolean
-motion_forward_line_end (GtkTextIter        *iter,
+motion_line_end_with_nl (GtkTextIter        *iter,
                          GtkSourceVimMotion *self)
 {
-       /* this version does not try to stay off the \n char, it is
-        * primarily used to do line selections like `S`, `3S`, etc.
-        */
-       if (gtk_text_iter_is_end (iter))
-               return FALSE;
-
-       if (gtk_text_iter_ends_line (iter))
-       {
-               gtk_text_iter_forward_char (iter);
-
-               if (gtk_text_iter_ends_line (iter))
-                       return TRUE;
-       }
-
        return gtk_text_iter_forward_to_line_end (iter);
 }
 
@@ -1488,7 +1474,7 @@ gtk_source_vim_motion_new_line_end_with_nl (void)
        GtkSourceVimMotion *self;
 
        self = g_object_new (GTK_SOURCE_TYPE_VIM_MOTION, NULL);
-       self->motion = motion_forward_line_end;
+       self->motion = motion_line_end_with_nl;
        self->inclusivity = EXCLUSIVE;
 
        return GTK_SOURCE_VIM_STATE (self);


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