diff --git a/pkg/cli/util.go b/pkg/cli/util.go index 34b3de3..f9966d7 100644 --- a/pkg/cli/util.go +++ b/pkg/cli/util.go @@ -3,6 +3,7 @@ package cli import ( "os" "os/exec" + "strings" ) // InputFromEditor retrieves user input by opening an editor (one specified by @@ -34,8 +35,15 @@ func InputFromEditor(placeholder string, pattern string) (string, error) { bytes, _ := os.ReadFile(msgFile.Name()) content := string(bytes) - if content == placeholder { - return "", nil + if placeholder != "" { + if content == placeholder { + return "", nil + } + + // strip placeholder if content begins with it + if strings.HasPrefix(content, placeholder) { + content = content[len(placeholder):] + } } return content, nil