summaryrefslogtreecommitdiffstats
path: root/pkg/gui/custom_commands.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-09-27 09:11:19 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-09-27 09:49:30 +1000
commit5724fa534aacdad4f73570794a4abaa7edbaf07d (patch)
tree5e07df2e03547ae14f56f4d94a8a43b0f8b5418e /pkg/gui/custom_commands.go
parente7210dd249d9196b419153e57c60597777bc5010 (diff)
fallback to value if name not given
Diffstat (limited to 'pkg/gui/custom_commands.go')
-rw-r--r--pkg/gui/custom_commands.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/gui/custom_commands.go b/pkg/gui/custom_commands.go
index 2e43e9892..4a90661b1 100644
--- a/pkg/gui/custom_commands.go
+++ b/pkg/gui/custom_commands.go
@@ -121,7 +121,12 @@ func (gui *Gui) handleCustomCommandKeybinding(customCommand CustomCommand) func(
for i, option := range prompt.Options {
option := option
- name, err := gui.resolveTemplate(option.Name, promptResponses)
+ nameTemplate := option.Name
+ if nameTemplate == "" {
+ // this allows you to only pass values rather than bother with names/descriptions
+ nameTemplate = option.Value
+ }
+ name, err := gui.resolveTemplate(nameTemplate, promptResponses)
if err != nil {
return gui.surfaceError(err)
}