[gtksourceview/wip/chergert/vim: 249/363] dont duplicate motion char in command buffer




commit 85e39a00151b8c83d32d913d5ee44b4c93556eb1
Author: Christian Hergert <chergert redhat com>
Date:   Wed Nov 3 14:20:13 2021 -0700

    dont duplicate motion char in command buffer

 gtksourceview/vim/gtk-source-vim-normal.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/gtksourceview/vim/gtk-source-vim-normal.c b/gtksourceview/vim/gtk-source-vim-normal.c
index ca99be9b..f86296fb 100644
--- a/gtksourceview/vim/gtk-source-vim-normal.c
+++ b/gtksourceview/vim/gtk-source-vim-normal.c
@@ -792,6 +792,9 @@ key_handler_motion (GtkSourceVimNormal *self,
 
        g_assert (GTK_SOURCE_IS_VIM_NORMAL (self));
 
+       if (self->command_text->len > 0)
+               g_string_truncate (self->command_text, self->command_text->len - 1);
+
        new_state = gtk_source_vim_motion_new ();
        gtk_source_vim_state_set_count (new_state, self->count);
        gtk_source_vim_state_push (GTK_SOURCE_VIM_STATE (self), new_state);


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