[gtksourceview/wip/chergert/vim: 257/293] dont duplicate motion char in command buffer




commit 3c92a5f9f36dfcf334609b098a817c2eaeba2c10
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]