summaryrefslogtreecommitdiffstats
path: root/pkg/gui/gui.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/gui/gui.go')
-rw-r--r--pkg/gui/gui.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go
index f156a6d60..fc40cda07 100644
--- a/pkg/gui/gui.go
+++ b/pkg/gui/gui.go
@@ -260,9 +260,18 @@ func (gui *Gui) onFocusLost(v *gocui.View) error {
return nil
}
+ // 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" {
+ // if we have lost focus to a popup panel, that's okay
+ if gui.popupPanelFocused() {
+ return nil
+ }
+
+ gui.g.SetViewOnBottom(v.Name())
}
gui.Log.Info(v.Name() + " focus lost")
return nil
@@ -358,7 +367,7 @@ func (gui *Gui) layout(g *gocui.Gui) error {
branchesView.FgColor = gocui.ColorWhite
}
- if v, err := g.SetView("commit files", 0, commitsBranchesBoundary+panelSpacing, leftSideWidth, commitsStashBoundary, gocui.TOP|gocui.BOTTOM); err != nil {
+ if v, err := g.SetView("commitFiles", 0, commitsBranchesBoundary+panelSpacing, leftSideWidth, commitsStashBoundary, gocui.TOP|gocui.BOTTOM); err != nil {
if err.Error() != "unknown view" {
return err
}