From 137831630aff924fb5fae5a1bab1d3c669d2d867 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Tue, 26 May 2026 07:54:29 +0200 Subject: [PATCH 1/2] Do less work to update the main view when cycling pagers The call to HandleFocus worked fine too, but it was doing too much; all we really need here is rerender the main view. --- pkg/gui/controllers/global_controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/gui/controllers/global_controller.go b/pkg/gui/controllers/global_controller.go index 1043ee88f..c472d1b7b 100644 --- a/pkg/gui/controllers/global_controller.go +++ b/pkg/gui/controllers/global_controller.go @@ -158,7 +158,7 @@ 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().HandleFocus(types.OnFocusOpts{}) + self.c.Context().CurrentSide().HandleRenderToMain() } current, total := self.c.State().GetPagerConfig().CurrentPagerIndex() From e6a8415162121d4b54cd1ec584ba8ed7f2cadf58 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Tue, 26 May 2026 07:57:32 +0200 Subject: [PATCH 2/2] 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()