summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2019-11-01 09:37:27 +1100
committerJesse Duffield <jessedduffield@gmail.com>2019-11-05 19:22:01 +1100
commitcc039d1f9b74dd246dc1eab389d67c592854def0 (patch)
tree1a30a792eb9123df5ca48c196e8c5c99f95bef2d
parent2484ec9c11a70d688648c613d74c828831c7c990 (diff)
don't unsplit main panel unconditionally on focus lost
-rw-r--r--pkg/gui/gui.go9
1 files changed, 4 insertions, 5 deletions
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
}