From e6a8415162121d4b54cd1ec584ba8ed7f2cadf58 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Tue, 26 May 2026 07:57:32 +0200 Subject: [PATCH] Refresh main view when cycling pagers with main view focused The previous logic only re-rendered the main view when the side panel itself was focused. When the user pressed `0` to focus the main view, the Normal/NormalSecondary context becomes Current and the equality check failed, so cycling pagers had no visible effect. Mirror the pattern from postRefreshUpdate: when the main view is focused, call HandleRenderToMain on the side panel below it on the stack (which CurrentSide already returns). --- pkg/gui/controllers/global_controller.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/gui/controllers/global_controller.go b/pkg/gui/controllers/global_controller.go index c472d1b7b..d2ca28c60 100644 --- a/pkg/gui/controllers/global_controller.go +++ b/pkg/gui/controllers/global_controller.go @@ -3,6 +3,7 @@ package controllers import ( "fmt" + "github.com/jesseduffield/lazygit/pkg/gui/context" "github.com/jesseduffield/lazygit/pkg/gui/types" ) @@ -157,8 +158,12 @@ func (self *GlobalController) prevScreenMode() error { func (self *GlobalController) cyclePagers() error { self.c.State().GetPagerConfig().CyclePagers() - if self.c.Context().CurrentSide().GetKey() == self.c.Context().Current().GetKey() { - self.c.Context().CurrentSide().HandleRenderToMain() + currentSide := self.c.Context().CurrentSide() + currentKey := self.c.Context().Current().GetKey() + if currentSide.GetKey() == currentKey || + currentKey == context.NORMAL_MAIN_CONTEXT_KEY || + currentKey == context.NORMAL_SECONDARY_CONTEXT_KEY { + currentSide.HandleRenderToMain() } current, total := self.c.State().GetPagerConfig().CurrentPagerIndex()