From 5b03b3cef432d64b3100d87c95782f659a97970b Mon Sep 17 00:00:00 2001 From: sammyette <38820196+TorchedSammy@users.noreply.github.com> Date: Fri, 11 Jun 2021 18:08:31 -0400 Subject: [PATCH] fix: return previous input on continue input error this is basically 72973eade78eb313a255b582112318b31ba9f473 but it actually works and doesnt break everything if an error occurred with the ContinuePrompt function (in this case, the error is simply EOL/ctrl d) then return previous input alone --- main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index c5acfca..d71195d 100644 --- a/main.go +++ b/main.go @@ -183,13 +183,14 @@ func main() { func ContinuePrompt(prev string) (string, error) { hooks.Em.Emit("multiline", nil) lr.SetPrompt(multilinePrompt) + cont, err := lr.Read() if err != nil { fmt.Println("") - return "", err + return prev, err } - cont = strings.TrimSpace(cont) + cont = strings.TrimSpace(cont) return prev + strings.TrimSuffix(cont, "\n"), nil }