After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 747343 - vim: treat "tabs" as buffers
vim: treat "tabs" as buffers
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: editor
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-04-04 18:10 UTC by Alexandre Franke
Modified: 2015-04-06 22:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
vim: add ":bnext" command (1.33 KB, patch)
2015-04-04 18:10 UTC, Alexandre Franke
committed Details | Review
vim: add ":bprevious" command (1.40 KB, patch)
2015-04-04 18:12 UTC, Alexandre Franke
committed Details | Review
add :buffers vim command (2.67 KB, patch)
2015-04-04 19:45 UTC, sébastien lafargue
none Details | Review
add :buffers vim command (2.76 KB, patch)
2015-04-06 21:56 UTC, sébastien lafargue
committed Details | Review

Description Alexandre Franke 2015-04-04 18:10:36 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.
Comment 1 Alexandre Franke 2015-04-04 18:10:41 UTC
Created attachment 300954 [details] [review]
vim: add ":bnext" command

Treats "tabs" as buffers and switches to the next one.
Comment 2 Alexandre Franke 2015-04-04 18:12:12 UTC
Created attachment 300955 [details] [review]
vim: add ":bprevious" command

Treats "tabs" as buffers and switches to the previous one.
Comment 3 Alexandre Franke 2015-04-04 18:16:22 UTC
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?
Comment 4 sébastien lafargue 2015-04-04 19:45:04 UTC
Created attachment 300957 [details] [review]
add :buffers vim command

Hi, this is the third patch.
Comment 5 Alexandre Franke 2015-04-04 20:28:42 UTC
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?
Comment 6 Christian Hergert 2015-04-06 21:26:28 UTC
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.
Comment 7 sébastien lafargue 2015-04-06 21:56:21 UTC
Created attachment 301038 [details] [review]
add :buffers vim command
Comment 8 Christian Hergert 2015-04-06 22:28:55 UTC
Attachment 300954 [details] pushed as d9b9b49 - vim: add ":bnext" command
Attachment 300955 [details] pushed as ee7b1b3 - vim: add ":bprevious" command
Comment 9 Christian Hergert 2015-04-06 22:31:08 UTC
Added a followup commit to ensure that the new SourceView get focused.