Return default text if skipping the text editor when prompted

If we are allowed to skip the editor _and_ we want to append the default
text to the editor if we'd opened it, we just return the default text.

Co-Authored-By: Mislav Marohnić <mislav@github.com>
This commit is contained in:
chemotaxis 2021-05-20 03:32:34 -04:00 committed by Mislav Marohnić
parent b166376211
commit d974dbd338

View file

@ -105,7 +105,7 @@ func (e *GhEditor) prompt(initialValue string, config *survey.PromptConfig) (int
}
if r == '\r' || r == '\n' {
if e.BlankAllowed {
return "", nil
return initialValue, nil
} else {
continue
}