[gnome-builder] vim: add ":buffers" command



commit f408a3e485d3a4e216da8dfe1ba339fcb24504bd
Author: Sebastien Lafargue <slafargue gnome org>
Date:   Mon Apr 6 23:52:09 2015 +0200

    vim: add ":buffers" command
    
    Show the popover list of buffers.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=747343

 src/views/gb-view-stack-actions.c |   13 +++++++++++++
 src/vim/gb-vim.c                  |   11 +++++++++++
 2 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/src/views/gb-view-stack-actions.c b/src/views/gb-view-stack-actions.c
index e0abaea..20bb63b 100644
--- a/src/views/gb-view-stack-actions.c
+++ b/src/views/gb-view-stack-actions.c
@@ -278,6 +278,18 @@ gb_view_stack_actions_go_backward (GSimpleAction *action,
     ide_back_forward_list_go_backward (self->back_forward_list);
 }
 
+static void
+gb_view_stack_actions_show_list (GSimpleAction *action,
+                                 GVariant      *param,
+                                 gpointer       user_data)
+{
+  GbViewStack *self = user_data;
+
+  g_assert (GB_IS_VIEW_STACK (self));
+
+  g_signal_emit_by_name (self->views_button, "activate");
+}
+
 static const GActionEntry gGbViewStackActions[] = {
   { "close",         gb_view_stack_actions_close },
   { "go-forward",    gb_view_stack_actions_go_forward },
@@ -286,6 +298,7 @@ static const GActionEntry gGbViewStackActions[] = {
   { "move-right",    gb_view_stack_actions_move_right },
   { "next-view",     gb_view_stack_actions_next_view },
   { "previous-view", gb_view_stack_actions_previous_view},
+  { "show-list",     gb_view_stack_actions_show_list},
   { "save",          gb_view_stack_actions_save },
   { "save-as",       gb_view_stack_actions_save_as },
   { "split-down",    NULL, NULL, "false", gb_view_stack_actions_split_down },
diff --git a/src/vim/gb-vim.c b/src/vim/gb-vim.c
index b75e5c8..4b3dbbb 100644
--- a/src/vim/gb-vim.c
+++ b/src/vim/gb-vim.c
@@ -608,6 +608,16 @@ gb_vim_command_cprevious (GtkSourceView  *source_view,
 }
 
 static gboolean
+gb_vim_command_buffers (GtkSourceView  *source_view,
+                        const gchar    *command,
+                        const gchar    *options,
+                        GError        **error)
+{
+  gb_widget_activate_action (GTK_WIDGET (source_view), "view-stack", "show-list", NULL);
+  return TRUE;
+}
+
+static gboolean
 gb_vim_jump_to_line (GtkSourceView  *source_view,
                      const gchar    *command,
                      const gchar    *options,
@@ -862,6 +872,7 @@ invalid_request:
 static const GbVimCommand vim_commands[] = {
   { "bnext",       gb_vim_command_bnext },
   { "bprevious",   gb_vim_command_bprevious },
+  { "buffers",     gb_vim_command_buffers },
   { "cnext",       gb_vim_command_cnext },
   { "colorscheme", gb_vim_command_colorscheme },
   { "cprevious",   gb_vim_command_cprevious },


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