diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2018-09-22 13:50:01 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2018-09-22 13:50:01 +1000 |
commit | 7947668e18318f07fccd21f399b47da292e69ddf (patch) | |
tree | a27b49d66b823efd760fad13207fc6a070a3cbfb /pkg/gui/view_helpers.go | |
parent | 619c28ce56c50b6472d75158211f4bc6141b1bfd (diff) | |
parent | 53aef7846aabac9ba83734c7e43f5c54dffe05d9 (diff) |
Merge branch 'hotfix/273-cursor-scrolling' of https://github.com/jesseduffield/lazygit into hotfix/273-cursor-scrolling
Diffstat (limited to 'pkg/gui/view_helpers.go')
-rw-r--r-- | pkg/gui/view_helpers.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/pkg/gui/view_helpers.go b/pkg/gui/view_helpers.go index e9362c41f..6c3e5505c 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", |