Fix cycling pagers when main view is focused (#5639)

Fixes #5638.
This commit is contained in:
Stefan Haller 2026-05-26 08:03:21 +02:00 committed by GitHub
commit 822807ce48
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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().HandleFocus(types.OnFocusOpts{})
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()