[gtksourceview/wip/chergert/vim] apply count to command if there is no motion



commit 2b82d10c2a35ed8256a8d1006f5277f2aac5b5c2
Author: Christian Hergert <chergert redhat com>
Date:   Fri Oct 29 12:40:48 2021 -0700

    apply count to command if there is no motion

 gtksourceview/vim/gtk-source-vim-normal.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/gtksourceview/vim/gtk-source-vim-normal.c b/gtksourceview/vim/gtk-source-vim-normal.c
index 1f27d4cc..3644742f 100644
--- a/gtksourceview/vim/gtk-source-vim-normal.c
+++ b/gtksourceview/vim/gtk-source-vim-normal.c
@@ -216,6 +216,14 @@ gtk_source_vim_normal_begin_command (GtkSourceVimNormal *self,
                                "command", command_str,
                                NULL);
 
+       /* If there are no motions, then we need to apply the count
+        * somewhere, just send it to the command.
+        */
+       if (insert_motion == NULL && selection_motion == NULL)
+       {
+               gtk_source_vim_state_set_count (GTK_SOURCE_VIM_STATE (command), count);
+       }
+
        g_clear_object (&insert_motion);
        g_clear_object (&selection_motion);
 


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