diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2019-11-16 16:20:05 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2019-11-21 22:07:14 +1100 |
commit | 92e43d9e7776cd2e1796bf280756c6ffa7c8dbe2 (patch) | |
tree | ac3b7ee152e6b8cde6268d8c329334041cfe0d97 /pkg/gui | |
parent | 325408d0e3db8e1b7d0b6915986f1a684ee8b257 (diff) |
allow changing tabs with [ and ]
Diffstat (limited to 'pkg/gui')
-rw-r--r-- | pkg/gui/branches_panel.go | 12 | ||||
-rw-r--r-- | pkg/gui/keybindings.go | 12 |
2 files changed, 24 insertions, 0 deletions
diff --git a/pkg/gui/branches_panel.go b/pkg/gui/branches_panel.go index 015f51739..a05d3ed2a 100644 --- a/pkg/gui/branches_panel.go +++ b/pkg/gui/branches_panel.go @@ -372,3 +372,15 @@ func (gui *Gui) refreshRemotes() error { return nil } + +func (gui *Gui) handleNextBranchesTab(g *gocui.Gui, v *gocui.View) error { + return gui.onBranchesTabClick( + utils.ModuloWithWrap(v.TabIndex+1, len(v.Tabs)), + ) +} + +func (gui *Gui) handlePrevBranchesTab(g *gocui.Gui, v *gocui.View) error { + return gui.onBranchesTabClick( + utils.ModuloWithWrap(v.TabIndex-1, len(v.Tabs)), + ) +} diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go index 6d198443f..ce3dc91c7 100644 --- a/pkg/gui/keybindings.go +++ b/pkg/gui/keybindings.go @@ -403,6 +403,18 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { Description: gui.Tr.SLocalize("FastForward"), }, { + ViewName: "branches", + Key: ']', + Modifier: gocui.ModNone, + Handler: gui.handleNextBranchesTab, + }, + { + ViewName: "branches", + Key: '[', + Modifier: gocui.ModNone, + Handler: gui.handlePrevBranchesTab, + }, + { ViewName: "commits", Key: 's', Modifier: gocui.ModNone, |