diff options
Diffstat (limited to 'pkg/gui/context.go')
-rw-r--r-- | pkg/gui/context.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/pkg/gui/context.go b/pkg/gui/context.go index 38e1212c7..90bb78768 100644 --- a/pkg/gui/context.go +++ b/pkg/gui/context.go @@ -376,3 +376,16 @@ func (self *ContextMgr) AllPatchExplorer() []types.IPatchExplorerContext { return listContexts } + +func (self *ContextMgr) ContextForKey(key types.ContextKey) types.Context { + self.RLock() + defer self.RUnlock() + + for _, context := range self.allContexts.Flatten() { + if context.GetKey() == key { + return context + } + } + + return nil +} |