mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-08 23:56:15 +02:00
Don't deactivate context that you're about to activate
This commit is contained in:
parent
9592686629
commit
00b03079d8
@ -105,7 +105,9 @@ func (self *ContextMgr) pushToContextStack(c types.Context) ([]types.Context, ty
|
|||||||
self.ContextStack = append(self.ContextStack, c)
|
self.ContextStack = append(self.ContextStack, c)
|
||||||
} else if c.GetKind() == types.SIDE_CONTEXT {
|
} else if c.GetKind() == types.SIDE_CONTEXT {
|
||||||
// if we are switching to a side context, remove all other contexts in the stack
|
// if we are switching to a side context, remove all other contexts in the stack
|
||||||
contextsToDeactivate = self.ContextStack
|
contextsToDeactivate = lo.Filter(self.ContextStack, func(context types.Context, _ int) bool {
|
||||||
|
return context.GetKey() != c.GetKey()
|
||||||
|
})
|
||||||
self.ContextStack = []types.Context{c}
|
self.ContextStack = []types.Context{c}
|
||||||
} else if c.GetKind() == types.MAIN_CONTEXT {
|
} else if c.GetKind() == types.MAIN_CONTEXT {
|
||||||
// if we're switching to a main context, remove all other main contexts in the stack
|
// if we're switching to a main context, remove all other main contexts in the stack
|
||||||
|
Loading…
x
Reference in New Issue
Block a user