Skip to content

Commit 5355731

Browse files
committed
Re-render focused main view on refresh if needed
1 parent 245ea50 commit 5355731

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkg/gui/view_helpers.go

+9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"time"
55

66
"github.com/jesseduffield/gocui"
7+
"github.com/jesseduffield/lazygit/pkg/gui/context"
78
"github.com/jesseduffield/lazygit/pkg/gui/types"
89
"github.com/jesseduffield/lazygit/pkg/tasks"
910
"github.com/jesseduffield/lazygit/pkg/utils"
@@ -136,5 +137,13 @@ func (gui *Gui) postRefreshUpdate(c types.Context) {
136137

137138
if gui.currentViewName() == c.GetViewName() {
138139
c.HandleFocus(types.OnFocusOpts{})
140+
} else {
141+
currentCtx := gui.State.ContextMgr.Current()
142+
if currentCtx.GetKey() == context.NORMAL_MAIN_CONTEXT_KEY || currentCtx.GetKey() == context.NORMAL_SECONDARY_CONTEXT_KEY {
143+
if !currentCtx.GetView().IsSearching() {
144+
parentCtx := currentCtx.GetParentContext()
145+
parentCtx.HandleRenderToMain()
146+
}
147+
}
139148
}
140149
}

0 commit comments

Comments
 (0)