1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-29 00:51:35 +02:00

don't unsplit main panel unconditionally on focus lost

This commit is contained in:
Jesse Duffield
2019-11-01 09:37:27 +11:00
parent 2484ec9c11
commit cc039d1f9b

View File

@ -263,20 +263,19 @@ func (gui *Gui) onFocusLost(v *gocui.View, newView *gocui.View) error {
if v == nil { if v == nil {
return nil return nil
} }
gui.State.SplitMainPanel = false switch v.Name() {
if v.Name() == "branches" { case "branches":
// This stops the branches panel from showing the upstream/downstream changes to the selected branch, when it loses focus // This stops the branches panel from showing the upstream/downstream changes to the selected branch, when it loses focus
// inside renderListPanel it checks to see if the panel has focus // inside renderListPanel it checks to see if the panel has focus
if err := gui.renderListPanel(gui.getBranchesView(), gui.State.Branches); err != nil { if err := gui.renderListPanel(gui.getBranchesView(), gui.State.Branches); err != nil {
return err return err
} }
} else if v.Name() == "main" { case "main":
// if we have lost focus to a first-class panel, we need to do some cleanup // if we have lost focus to a first-class panel, we need to do some cleanup
if err := gui.changeContext("main", "normal"); err != nil { if err := gui.changeContext("main", "normal"); err != nil {
return err return err
} }
case "commitFiles":
} else if v.Name() == "commitFiles" {
if _, err := gui.g.SetViewOnBottom(v.Name()); err != nil { if _, err := gui.g.SetViewOnBottom(v.Name()); err != nil {
return err return err
} }