summaryrefslogtreecommitdiffstats
path: root/pkg/gui/view_helpers.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2018-09-19 20:36:40 +1000
committerJesse Duffield <jessedduffield@gmail.com>2018-09-19 20:36:40 +1000
commitb9708c9f8850352d18ef4d10c285698be882f838 (patch)
tree8de824457cbbc104f4dd7290213b80708465daa1 /pkg/gui/view_helpers.go
parent7b90d2496b56d89863b552b226f45b8de2bd1551 (diff)
fix issues with commit message panel losing focus
Diffstat (limited to 'pkg/gui/view_helpers.go')
-rw-r--r--pkg/gui/view_helpers.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/pkg/gui/view_helpers.go b/pkg/gui/view_helpers.go
index 5178bd4d9..96a77f3d6 100644
--- a/pkg/gui/view_helpers.go
+++ b/pkg/gui/view_helpers.go
@@ -133,8 +133,15 @@ func (gui *Gui) switchFocus(g *gocui.Gui, oldView, newView *gocui.View) error {
},
)
gui.Log.Info(message)
- gui.State.PreviousView = oldView.Name()
+
+ // second class panels should never have focus restored to them because
+ // once they lose focus they are effectively 'destroyed'
+ secondClassPanels := []string{"confirmation", "menu"}
+ if !utils.IncludesString(secondClassPanels, oldView.Name()) {
+ gui.State.PreviousView = oldView.Name()
+ }
}
+
newView.Highlight = true
message := gui.Tr.TemplateLocalize(
"newFocusedViewIs",