summaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rw-r--r--pkg/gui/branches_panel.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/pkg/gui/branches_panel.go b/pkg/gui/branches_panel.go
index 154149a33..dabe995cb 100644
--- a/pkg/gui/branches_panel.go
+++ b/pkg/gui/branches_panel.go
@@ -367,11 +367,18 @@ func (gui *Gui) onBranchesTabClick(tabIndex int) error {
return gui.switchBranchesPanelContext(contexts[tabIndex])
}
-// TODO: make this switch tabs as well if necessary
func (gui *Gui) switchBranchesPanelContext(context string) error {
branchesView := gui.getBranchesView()
branchesView.Context = context
+ contextTabIndexMap := map[string]int{
+ "local-branches": 0,
+ "remotes": 1,
+ "remote-branches": 1,
+ }
+
+ branchesView.TabIndex = contextTabIndexMap[context]
+
switch context {
case "local-branches":
return gui.renderLocalBranchesWithSelection()