From cc039d1f9b74dd246dc1eab389d67c592854def0 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Fri, 1 Nov 2019 09:37:27 +1100 Subject: don't unsplit main panel unconditionally on focus lost --- pkg/gui/gui.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'pkg') diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index f499895a1..e66df31d8 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -263,20 +263,19 @@ func (gui *Gui) onFocusLost(v *gocui.View, newView *gocui.View) error { if v == nil { return nil } - gui.State.SplitMainPanel = false - if v.Name() == "branches" { + switch v.Name() { + case "branches": // This stops the branches panel from showing the upstream/downstream changes to the selected branch, when it loses focus // inside renderListPanel it checks to see if the panel has focus if err := gui.renderListPanel(gui.getBranchesView(), gui.State.Branches); err != nil { return err } - } else if v.Name() == "main" { + case "main": // if we have lost focus to a first-class panel, we need to do some cleanup if err := gui.changeContext("main", "normal"); err != nil { return err } - - } else if v.Name() == "commitFiles" { + case "commitFiles": if _, err := gui.g.SetViewOnBottom(v.Name()); err != nil { return err } -- cgit v1.2.3