1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

minor cleanup

This commit is contained in:
Jesse Duffield
2019-03-11 09:28:47 +11:00
parent 06fe726ee7
commit 1ad9c6faac
9 changed files with 42 additions and 10 deletions

View File

@ -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
}