[gtksourceview/wip/chergert/vim] fix D delete/motion



commit 8edac388fda37ed95923d61b843ad4d1262c919b
Author: Christian Hergert <chergert redhat com>
Date:   Wed Oct 27 16:25:16 2021 -0700

    fix D delete/motion

 gtksourceview/vim/gtk-source-vim-delete.c | 7 +++++++
 gtksourceview/vim/gtk-source-vim-motion.c | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/gtksourceview/vim/gtk-source-vim-delete.c b/gtksourceview/vim/gtk-source-vim-delete.c
index 482c557a..91ac0ca7 100644
--- a/gtksourceview/vim/gtk-source-vim-delete.c
+++ b/gtksourceview/vim/gtk-source-vim-delete.c
@@ -139,6 +139,13 @@ gtk_source_vim_delete_leave (GtkSourceVimState *state)
                buffer = gtk_source_vim_state_get_buffer (state, &insert, &selection);
                gtk_source_vim_motion_apply (self->motion, &insert, TRUE);
                gtk_text_buffer_delete (GTK_TEXT_BUFFER (buffer), &insert, &selection);
+
+               if (gtk_text_iter_ends_line (&insert) &&
+                   !gtk_text_iter_starts_line (&insert))
+               {
+                       gtk_text_iter_backward_char (&insert);
+                       gtk_source_vim_state_select (state, &insert, &insert);
+               }
        }
 }
 
diff --git a/gtksourceview/vim/gtk-source-vim-motion.c b/gtksourceview/vim/gtk-source-vim-motion.c
index e5fa1db2..a5dac8fc 100644
--- a/gtksourceview/vim/gtk-source-vim-motion.c
+++ b/gtksourceview/vim/gtk-source-vim-motion.c
@@ -1404,7 +1404,7 @@ gtk_source_vim_motion_new_line_end (void)
 
        self = g_object_new (GTK_SOURCE_TYPE_VIM_MOTION, NULL);
        self->motion = motion_line_end;
-       self->inclusivity = EXCLUSIVE;
+       self->inclusivity = INCLUSIVE;
 
        return GTK_SOURCE_VIM_STATE (self);
 }


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