GNOME Bugzilla – Bug 747343
vim: treat "tabs" as buffers
Last modified: 2015-04-06 22:31:08 UTC
Since the opened documents aren't constantly displayed like they would be if we still had real tabs, they are essentially buffers now. vim has this concept (which some prefer to tabs) and has related commands. There's no reason why we shouldn't handle these.
Created attachment 300954 [details] [review] vim: add ":bnext" command Treats "tabs" as buffers and switches to the next one.
Created attachment 300955 [details] [review] vim: add ":bprevious" command Treats "tabs" as buffers and switches to the previous one.
I'm working on a third patch that adds :buffers (show all buffers), but I'm having a hard time opening the views_popover so far. Should I add a public function to src/views/gb-view-stack.c to do that?
Created attachment 300957 [details] [review] add :buffers vim command Hi, this is the third patch.
Review of attachment 300957 [details] [review]: I was rather hoping for a hint so that I could go and try to do it on my own, but thanks for doing it. ::: src/views/gb-view-stack-actions.c @@ +282,3 @@ +gb_view_stack_actions_show_list (GSimpleAction *action, + GVariant *param, + gpointer user_data) Ok, that's easier than what I thought. Thanks. ::: src/vim/gb-vim.c @@ +852,2 @@ static const GbVimCommand vim_commands[] = { + { "buffers", gb_vim_command_buffers }, :ls is an alias for :buffers. Should we just have a second similar line with { "ls", gb_vim_command_buffers }, or do we need something more complicated?
This doesn't apply cleanly against master (at least with git-bz). Can you update the match against master and then it's probably good for commit.
Created attachment 301038 [details] [review] add :buffers vim command
Attachment 300954 [details] pushed as d9b9b49 - vim: add ":bnext" command Attachment 300955 [details] pushed as ee7b1b3 - vim: add ":bprevious" command
Added a followup commit to ensure that the new SourceView get focused.