[gtksourceview/wip/chergert/vim: 207/363] allow yanking in visual mode




commit 2d2409bfa2c4d4ca826e529d456d7a68d468810e
Author: Christian Hergert <chergert redhat com>
Date:   Tue Nov 2 13:19:46 2021 -0700

    allow yanking in visual mode

 gtksourceview/vim/gtk-source-vim-visual.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
---
diff --git a/gtksourceview/vim/gtk-source-vim-visual.c b/gtksourceview/vim/gtk-source-vim-visual.c
index 37747039..2b033cb3 100644
--- a/gtksourceview/vim/gtk-source-vim-visual.c
+++ b/gtksourceview/vim/gtk-source-vim-visual.c
@@ -23,6 +23,7 @@
 
 #include <glib/gi18n.h>
 
+#include "gtk-source-vim-command.h"
 #include "gtk-source-vim-delete.h"
 #include "gtk-source-vim-motion.h"
 #include "gtk-source-vim-visual.h"
@@ -313,6 +314,19 @@ key_handler_initial (GtkSourceVimVisual *self,
                        self->handler = key_handler_register;
                        return TRUE;
 
+               case GDK_KEY_y:
+               {
+                       GtkSourceVimState *command;
+                       command = g_object_new (GTK_SOURCE_TYPE_VIM_COMMAND,
+                                               "parent", self,
+                                               "command", ":yank",
+                                               NULL);
+                       gtk_source_vim_state_repeat (command);
+                       gtk_source_vim_state_pop (GTK_SOURCE_VIM_STATE (self));
+                       g_object_unref (command);
+                       return TRUE;
+               }
+
                default:
                        break;
        }


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