[gtksourceview/wip/chergert/vim: 281/293] add command stub for gq in visual




commit f293f39ad602e326bf0f9aba56bbc5c6ea387a2d
Author: Christian Hergert <chergert redhat com>
Date:   Wed Nov 3 17:20:04 2021 -0700

    add command stub for gq in visual

 gtksourceview/vim/gtk-source-vim-command.c | 7 +++++++
 gtksourceview/vim/gtk-source-vim-visual.c  | 3 +++
 2 files changed, 10 insertions(+)
---
diff --git a/gtksourceview/vim/gtk-source-vim-command.c b/gtksourceview/vim/gtk-source-vim-command.c
index 4d0c9819..c2406f47 100644
--- a/gtksourceview/vim/gtk-source-vim-command.c
+++ b/gtksourceview/vim/gtk-source-vim-command.c
@@ -57,6 +57,12 @@ enum {
 static GParamSpec *properties[N_PROPS];
 static GHashTable *commands;
 
+static void
+gtk_source_vim_command_format (GtkSourceVimCommand *self)
+{
+       /* TODO */
+}
+
 static void
 gtk_source_vim_command_shift (GtkSourceVimCommand *self,
                               int                  direction)
@@ -751,6 +757,7 @@ gtk_source_vim_command_class_init (GtkSourceVimCommandClass *klass)
        ADD_COMMAND ("replace-one",    gtk_source_vim_command_replace_one);
        ADD_COMMAND ("indent",         gtk_source_vim_command_indent);
        ADD_COMMAND ("unindent",       gtk_source_vim_command_unindent);
+       ADD_COMMAND ("format",         gtk_source_vim_command_format);
 #undef ADD_COMMAND
 }
 
diff --git a/gtksourceview/vim/gtk-source-vim-visual.c b/gtksourceview/vim/gtk-source-vim-visual.c
index 35c26c62..fad821c7 100644
--- a/gtksourceview/vim/gtk-source-vim-visual.c
+++ b/gtksourceview/vim/gtk-source-vim-visual.c
@@ -473,6 +473,9 @@ key_handler_g (GtkSourceVimVisual *self,
                case GDK_KEY_question:
                        return gtk_source_vim_visual_begin_command (self, "rot13", TRUE);
 
+               case GDK_KEY_q:
+                       return gtk_source_vim_visual_begin_command (self, "format", FALSE);
+
                default:
                        new_state = gtk_source_vim_motion_new ();
                        gtk_source_vim_motion_set_mark (GTK_SOURCE_VIM_MOTION (new_state), self->cursor);


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