X Tutup
Skip to content

Commit d974dbd

Browse files
chemotaxismislav
andcommitted
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>
1 parent b166376 commit d974dbd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/surveyext/editor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func (e *GhEditor) prompt(initialValue string, config *survey.PromptConfig) (int
105105
}
106106
if r == '\r' || r == '\n' {
107107
if e.BlankAllowed {
108-
return "", nil
108+
return initialValue, nil
109109
} else {
110110
continue
111111
}

0 commit comments

Comments
 (0)
X Tutup