summaryrefslogtreecommitdiffstats
path: root/pkg/gui/custom_commands.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-09-27 11:04:57 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-09-27 11:11:55 +1000
commit12f9b1416fdf06871f54f5027a56749600599080 (patch)
treefa3cc4f60763c0be7e4449090ebed7a56c17dba9 /pkg/gui/custom_commands.go
parent4dad7064cc48a1e6bf0504aa9d8745ab29f8e78e (diff)
better handling of global custom keybindings
Diffstat (limited to 'pkg/gui/custom_commands.go')
-rw-r--r--pkg/gui/custom_commands.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/gui/custom_commands.go b/pkg/gui/custom_commands.go
index 655e1771f..034dd3381 100644
--- a/pkg/gui/custom_commands.go
+++ b/pkg/gui/custom_commands.go
@@ -212,6 +212,7 @@ func (gui *Gui) GetCustomCommandKeybindings() []*Binding {
for _, customCommand := range customCommands {
var viewName string
+ var contexts []string
switch customCommand.Context {
case "global":
viewName = ""
@@ -226,11 +227,12 @@ func (gui *Gui) GetCustomCommandKeybindings() []*Binding {
// Currently this is a safe bet but it's by no means guaranteed in the long term
// and we might need to make some changes in the future to support it.
viewName = context.GetViewName()
+ contexts = []string{customCommand.Context}
}
bindings = append(bindings, &Binding{
ViewName: viewName,
- Contexts: []string{customCommand.Context},
+ Contexts: contexts,
Key: gui.getKey(customCommand.Key),
Modifier: gocui.ModNone,
Handler: gui.wrappedHandler(gui.handleCustomCommandKeybinding(customCommand)),