From d974dbd338893027432a078248d35a78dbe765a2 Mon Sep 17 00:00:00 2001 From: chemotaxis Date: Thu, 20 May 2021 03:32:34 -0400 Subject: [PATCH] Return default text if skipping the text editor when prompted MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ć --- pkg/surveyext/editor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/surveyext/editor.go b/pkg/surveyext/editor.go index 21a358aa0..f868ed671 100644 --- a/pkg/surveyext/editor.go +++ b/pkg/surveyext/editor.go @@ -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 }