diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2019-03-11 09:28:47 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2019-03-16 10:20:27 +1100 |
commit | 1ad9c6faac18d5a683d631452e6a8f8f9c88b9da (patch) | |
tree | d28fadec1483d4bf269fc1a8af83bed848621ae3 /pkg/gui/gui.go | |
parent | 06fe726ee79d3993d936ae3e064761273b657ae8 (diff) |
minor cleanup
Diffstat (limited to 'pkg/gui/gui.go')
-rw-r--r-- | pkg/gui/gui.go | 11 |
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 } |