summaryrefslogtreecommitdiffstats
path: root/pkg/gui/context.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/gui/context.go')
-rw-r--r--pkg/gui/context.go13
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
+}