From f3466e2525288ad247d86e3ca7a1c364f59ead9d Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Mon, 19 May 2025 09:15:40 +0200 Subject: [PATCH] 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. --- pkg/gui/view_helpers.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/gui/view_helpers.go b/pkg/gui/view_helpers.go index 706f5863b..383550d91 100644 --- a/pkg/gui/view_helpers.go +++ b/pkg/gui/view_helpers.go @@ -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() + } } } }