1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-01 00:54:58 +02:00

only refresh branches panel on focus lost when in the local-branches context

This commit is contained in:
Jesse Duffield
2019-11-17 09:42:17 +11:00
parent 986abc1e45
commit 6bd0979b4a

View File

@ -314,10 +314,12 @@ func (gui *Gui) onFocusLost(v *gocui.View, newView *gocui.View) error {
} }
switch v.Name() { switch v.Name() {
case "branches": case "branches":
// This stops the branches panel from showing the upstream/downstream changes to the selected branch, when it loses focus if v.Context == "local-branches" {
// inside renderListPanel it checks to see if the panel has focus // This stops the branches panel from showing the upstream/downstream changes to the selected branch, when it loses focus
if err := gui.renderListPanel(gui.getBranchesView(), gui.State.Branches); err != nil { // inside renderListPanel it checks to see if the panel has focus
return err if err := gui.renderListPanel(gui.getBranchesView(), gui.State.Branches); err != nil {
return err
}
} }
case "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