summaryrefslogtreecommitdiffstats
path: root/pkg/gui/gui.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2019-03-02 13:22:02 +1100
committerJesse Duffield <jessedduffield@gmail.com>2019-03-02 17:45:53 +1100
commit1337f6e76ad5a9293b2d32fd29cbe91e750814c6 (patch)
tree6ae1f0d78f6550d0c0b6f04e195303f08072077a /pkg/gui/gui.go
parent4de31da4bee9c622d4c6b7152e4d918b79cb4a94 (diff)
appease golangci
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 69018814e..b4a55cc45 100644
--- a/pkg/gui/gui.go
+++ b/pkg/gui/gui.go
@@ -248,6 +248,15 @@ func (gui *Gui) onFocusLost(v *gocui.View) error {
if err := gui.renderListPanel(gui.getBranchesView(), gui.State.Branches); err != nil {
return err
}
+ } else if v.Name() == "main" {
+ // if we have lost focus to a popup panel, that's okay
+ if gui.popupPanelFocused() {
+ return nil
+ }
+
+ if err := gui.changeContext("main", "normal"); err != nil {
+ return err
+ }
}
gui.Log.Info(v.Name() + " focus lost")
return nil
@@ -521,7 +530,7 @@ func (gui *Gui) renderGlobalOptions() error {
func (gui *Gui) goEvery(interval time.Duration, function func() error) {
go func() {
for range time.Tick(interval) {
- function()
+ _ = function()
}
}()
}