From 00b03079d88464916528df720d8b85f08ce6a6a3 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Tue, 16 May 2023 20:24:17 +1000 Subject: [PATCH] Don't deactivate context that you're about to activate --- pkg/gui/context.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/gui/context.go b/pkg/gui/context.go index 7d3b32a1d..b55713f27 100644 --- a/pkg/gui/context.go +++ b/pkg/gui/context.go @@ -105,7 +105,9 @@ func (self *ContextMgr) pushToContextStack(c types.Context) ([]types.Context, ty self.ContextStack = append(self.ContextStack, c) } else if c.GetKind() == types.SIDE_CONTEXT { // 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} } else if c.GetKind() == types.MAIN_CONTEXT { // if we're switching to a main context, remove all other main contexts in the stack