[gtksourceview/wip/chergert/vim] counts for movements w/ yank



commit 86f48364590f4abb4509224b377a01d02ff2da6a
Author: Christian Hergert <chergert redhat com>
Date:   Fri Oct 29 17:27:54 2021 -0700

    counts for movements w/ yank

 gtksourceview/vim/gtk-source-vim-normal.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/gtksourceview/vim/gtk-source-vim-normal.c b/gtksourceview/vim/gtk-source-vim-normal.c
index baf49342..2128fbcb 100644
--- a/gtksourceview/vim/gtk-source-vim-normal.c
+++ b/gtksourceview/vim/gtk-source-vim-normal.c
@@ -609,6 +609,7 @@ key_handler_yank (GtkSourceVimNormal *self,
        GtkSourceVimState *new_state;
        GtkSourceVimState *selection_motion;
        GtkSourceVimState *insert_motion;
+       int count;
 
        g_assert (GTK_SOURCE_IS_VIM_NORMAL (self));
 
@@ -626,10 +627,13 @@ key_handler_yank (GtkSourceVimNormal *self,
        }
 
        selection_motion = gtk_source_vim_motion_new_none ();
-
        insert_motion = gtk_source_vim_motion_new ();
        gtk_source_vim_motion_set_apply_on_leave (GTK_SOURCE_VIM_MOTION (insert_motion), FALSE);
 
+       /* Apply count to motion */
+       count = self->count, self->count = 0;
+       gtk_source_vim_state_set_count (GTK_SOURCE_VIM_STATE (insert_motion), count);
+
        new_state = g_object_new (GTK_SOURCE_TYPE_VIM_COMMAND,
                                  "command", ":yank",
                                  "selection-motion", selection_motion,


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