[gtksourceview/wip/chergert/vim: 222/363] implement g?<motion> in normal mode




commit a9aac2594282b573fe0f2fe8be7331fe125ba39b
Author: Christian Hergert <chergert redhat com>
Date:   Tue Nov 2 15:25:45 2021 -0700

    implement g?<motion> in normal mode

 gtksourceview/vim/gtk-source-vim-normal.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
---
diff --git a/gtksourceview/vim/gtk-source-vim-normal.c b/gtksourceview/vim/gtk-source-vim-normal.c
index caaa9fdc..d50094ea 100644
--- a/gtksourceview/vim/gtk-source-vim-normal.c
+++ b/gtksourceview/vim/gtk-source-vim-normal.c
@@ -744,6 +744,29 @@ key_handler_g (GtkSourceVimNormal *self,
 
        switch (keyval)
        {
+               case GDK_KEY_question:
+               {
+                       GtkSourceVimState *motion;
+                       GtkSourceVimState *selection_motion;
+
+                       new_state = gtk_source_vim_command_new ("rot13");
+                       motion = gtk_source_vim_motion_new ();
+                       selection_motion = gtk_source_vim_motion_new_none ();
+
+                       gtk_source_vim_motion_set_apply_on_leave (GTK_SOURCE_VIM_MOTION (motion), FALSE);
+                       gtk_source_vim_command_set_selection_motion (GTK_SOURCE_VIM_COMMAND (new_state),
+                                                                    GTK_SOURCE_VIM_MOTION 
(selection_motion));
+
+                       gtk_source_vim_state_push (GTK_SOURCE_VIM_STATE (self), new_state);
+                       gtk_source_vim_state_push (GTK_SOURCE_VIM_STATE (new_state), motion);
+
+                       g_assert (gtk_source_vim_state_get_current (GTK_SOURCE_VIM_STATE (self)) == motion);
+
+                       g_object_unref (selection_motion);
+
+                       return TRUE;
+               }
+
                case GDK_KEY_g:
                case GDK_KEY_e:
                case GDK_KEY_E:


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