summaryrefslogtreecommitdiffstats
path: root/pkg/gui/keybindings.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-09-26 17:15:13 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-09-27 09:49:30 +1000
commitda8eac5538b236e4b79e3bab6465e8d5666c48e0 (patch)
tree95b8332360e10990dd8ea7047d53a89510e91471 /pkg/gui/keybindings.go
parent67bbeb195b52121976840de0cd1a20cf1462b5e0 (diff)
better interface
Diffstat (limited to 'pkg/gui/keybindings.go')
-rw-r--r--pkg/gui/keybindings.go35
1 files changed, 0 insertions, 35 deletions
diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go
index 8b6e80d20..d7b62051d 100644
--- a/pkg/gui/keybindings.go
+++ b/pkg/gui/keybindings.go
@@ -1563,41 +1563,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
return bindings
}
-func (gui *Gui) GetCustomCommandKeybindings() []*Binding {
- bindings := []*Binding{}
-
- ms := gui.Config.GetUserConfig().GetStringMap("customCommands")
- for contextKey := range ms {
- var viewName string
- if contextKey == "global" {
- viewName = ""
- } else {
- context := gui.contextForContextKey(contextKey)
- if context == nil {
- log.Fatalf("Error when setting custom command keybindings: unknown context: %s", contextKey)
- }
- // here we assume that a given context will always belong to the same view.
- // 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()
- }
-
- keyMap := gui.Config.GetUserConfig().GetStringMapString(fmt.Sprintf("customCommands.%s", contextKey))
- for key, command := range keyMap {
- bindings = append(bindings, &Binding{
- ViewName: viewName,
- Contexts: []string{contextKey},
- Key: gui.getKey(key),
- Modifier: gocui.ModNone,
- Handler: gui.wrappedHandler(gui.handleCustomCommandKeybinding(command)),
- Description: command,
- })
- }
- }
-
- return bindings
-}
-
func (gui *Gui) keybindings() error {
bindings := gui.GetCustomCommandKeybindings()