diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-09-27 09:11:19 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-09-27 09:49:30 +1000 |
commit | 5724fa534aacdad4f73570794a4abaa7edbaf07d (patch) | |
tree | 5e07df2e03547ae14f56f4d94a8a43b0f8b5418e /pkg/gui | |
parent | e7210dd249d9196b419153e57c60597777bc5010 (diff) |
fallback to value if name not given
Diffstat (limited to 'pkg/gui')
-rw-r--r-- | pkg/gui/custom_commands.go | 7 |
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) } |