diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-09-27 11:29:10 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-09-27 11:32:54 +1000 |
commit | de482262e12e989f3d4bede2057d2f0f2402e0ae (patch) | |
tree | b58489beb5440ca30fbcd82879ddfd20da22bdd3 /pkg/gui/custom_commands.go | |
parent | 1b39c829accab89a1efe0b900de083e9f127222d (diff) |
support setting description in custom command
Diffstat (limited to 'pkg/gui/custom_commands.go')
-rw-r--r-- | pkg/gui/custom_commands.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/pkg/gui/custom_commands.go b/pkg/gui/custom_commands.go index 034dd3381..d13c2d918 100644 --- a/pkg/gui/custom_commands.go +++ b/pkg/gui/custom_commands.go @@ -199,6 +199,7 @@ type CustomCommand struct { Subprocess bool `yaml:"subprocess"` Prompts []CustomCommandPrompt `yaml:"prompts"` LoadingText string `yaml:"loadingText"` + Description string `yaml:"description"` } func (gui *Gui) GetCustomCommandKeybindings() []*Binding { @@ -230,13 +231,18 @@ func (gui *Gui) GetCustomCommandKeybindings() []*Binding { contexts = []string{customCommand.Context} } + description := customCommand.Description + if description == "" { + description = customCommand.Command + } + bindings = append(bindings, &Binding{ ViewName: viewName, Contexts: contexts, Key: gui.getKey(customCommand.Key), Modifier: gocui.ModNone, Handler: gui.wrappedHandler(gui.handleCustomCommandKeybinding(customCommand)), - Description: customCommand.Command, + Description: description, }) } |