1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

Add ContextMgr.NextInStack and use it to access side panel of focused main view

This way we don't have to abuse the parent context mechanism, which isn't meant
for this purpose.
This commit is contained in:
Stefan Haller
2025-05-22 08:19:13 +02:00
parent 12ed50464b
commit bbd17abc43
7 changed files with 29 additions and 11 deletions

View File

@ -131,7 +131,9 @@ func (self *ContextLinesController) currentSidePanel() types.Context {
currentContext := self.c.Context().CurrentStatic()
if currentContext.GetKey() == context.NORMAL_MAIN_CONTEXT_KEY ||
currentContext.GetKey() == context.NORMAL_SECONDARY_CONTEXT_KEY {
return currentContext.GetParentContext()
if sidePanelContext := self.c.Context().NextInStack(currentContext); sidePanelContext != nil {
return sidePanelContext
}
}
return currentContext