diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-23 11:23:32 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-23 14:29:18 +1000 |
commit | bd661629720d38d10a06fab254266ec2968e3f0a (patch) | |
tree | 0fe7012373ffa5efb1934c73921909e26ffb3cee /pkg/gui/context.go | |
parent | 5cdfd41dca3ee2c080e8f3d40cfdc147e0b8a595 (diff) |
fix up patch manager
Diffstat (limited to 'pkg/gui/context.go')
-rw-r--r-- | pkg/gui/context.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/pkg/gui/context.go b/pkg/gui/context.go index 7b74d94a3..b198cb7e9 100644 --- a/pkg/gui/context.go +++ b/pkg/gui/context.go @@ -343,6 +343,21 @@ func (gui *Gui) viewTabContextMap() map[string][]tabContext { } } +func (gui *Gui) currentContextKeyIgnoringPopups() string { + stack := gui.State.ContextStack + + for i := range stack { + reversedIndex := len(stack) - 1 - i + context := stack[reversedIndex] + kind := stack[reversedIndex].GetKind() + if kind != TEMPORARY_POPUP && kind != PERSISTENT_POPUP { + return context.GetKey() + } + } + + return "" +} + func (gui *Gui) switchContext(c Context) error { gui.g.Update(func(*gocui.Gui) error { // push onto stack |