diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-19 09:05:43 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-23 14:29:18 +1000 |
commit | 2fdadd383a2609921abd4aeb99e67bd5f1bbc0fc (patch) | |
tree | f52567d882bcf505ef05bfe9efed51eee28157ac /pkg/gui/remote_branches_panel.go | |
parent | 9a2dc3fe150a03ccb4f086b05d8a8249c9e6c37f (diff) |
introduce new approach to handling tab states
Diffstat (limited to 'pkg/gui/remote_branches_panel.go')
-rw-r--r-- | pkg/gui/remote_branches_panel.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg/gui/remote_branches_panel.go b/pkg/gui/remote_branches_panel.go index 01f801de1..f6c213de8 100644 --- a/pkg/gui/remote_branches_panel.go +++ b/pkg/gui/remote_branches_panel.go @@ -48,7 +48,7 @@ func (gui *Gui) handleRemoteBranchSelect() error { } func (gui *Gui) handleRemoteBranchesEscape(g *gocui.Gui, v *gocui.View) error { - return gui.switchBranchesPanelContext("remotes") + return gui.switchContext(gui.Contexts.Remotes.Context) } func (gui *Gui) renderRemoteBranchesWithSelection() error { @@ -74,7 +74,7 @@ func (gui *Gui) handleCheckoutRemoteBranch(g *gocui.Gui, v *gocui.View) error { if err := gui.handleCheckoutRef(remoteBranch.FullName(), handleCheckoutRefOptions{}); err != nil { return err } - return gui.switchBranchesPanelContext("local-branches") + return gui.switchContext(gui.Contexts.Branches.Context) } func (gui *Gui) handleMergeRemoteBranch(g *gocui.Gui, v *gocui.View) error { @@ -163,7 +163,8 @@ func (gui *Gui) handleNewBranchOffRemote(g *gocui.Gui, v *gocui.View) error { return gui.surfaceError(err) } gui.State.Panels.Branches.SelectedLine = 0 - if err := gui.switchBranchesPanelContext("local-branches"); err != nil { + + if err := gui.switchContext(gui.Contexts.Branches.Context); err != nil { return err } return gui.refreshSidePanels(refreshOptions{mode: ASYNC}) |