mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-31 14:24:25 +03:00
Don't deactivate context that you're about to activate
This commit is contained in:
@ -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
|
||||||
|
Reference in New Issue
Block a user