diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-09-30 21:12:03 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-10-02 08:09:42 +1000 |
commit | d4ab607d0dd94f73eb1dcd4ba9842eb86b6aa0f4 (patch) | |
tree | 4cb72d33183f60fc8a943dd35d7299ce07d44cee /pkg/gui/custom_commands.go | |
parent | ea307c8d94623bd0279297db2cf3990492998ab4 (diff) |
allow adding a submodule
Diffstat (limited to 'pkg/gui/custom_commands.go')
-rw-r--r-- | pkg/gui/custom_commands.go | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/pkg/gui/custom_commands.go b/pkg/gui/custom_commands.go index df148a7af..74a07e9d1 100644 --- a/pkg/gui/custom_commands.go +++ b/pkg/gui/custom_commands.go @@ -1,10 +1,8 @@ package gui import ( - "bytes" "log" "strings" - "text/template" "github.com/fatih/color" "github.com/jesseduffield/gocui" @@ -43,19 +41,7 @@ func (gui *Gui) resolveTemplate(templateStr string, promptResponses []string) (s PromptResponses: promptResponses, } - tmpl, err := template.New("template").Parse(templateStr) - if err != nil { - return "", err - } - - var buf bytes.Buffer - if err := tmpl.Execute(&buf, objects); err != nil { - return "", err - } - - cmdStr := buf.String() - - return cmdStr, nil + return utils.ResolveTemplate(templateStr, objects) } func (gui *Gui) handleCustomCommandKeybinding(customCommand CustomCommand) func() error { |