1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-08 22:36:49 +02:00

Render the main view only for the side context that it belongs to

Previously we would re-render the focused main view several times during a
refresh, once for every side panel. While this should usually not be noticeable
for users because we are careful to avoid flicker when refreshing the main view,
this would sometimes lead to the main view scrolling up to the top by itself;
see PR description for more details.
This commit is contained in:
Stefan Haller
2025-05-19 09:15:40 +02:00
parent 7a24c5628a
commit f3466e2525

View File

@@ -153,7 +153,9 @@ func (gui *Gui) postRefreshUpdate(c types.Context) {
// either search or change their data, but not both at the same time.
if !currentCtx.GetView().IsSearching() {
parentCtx := currentCtx.GetParentContext()
parentCtx.HandleRenderToMain()
if parentCtx.GetKey() == c.GetKey() {
parentCtx.HandleRenderToMain()
}
}
}
}