revert: fix: return previous input on continue input error

This reverts commit 5b03b3cef4.
we shouldn't return this just to fix the panic,
instead just handle the error
pull/61/head
sammyette 2021-06-11 18:25:24 -04:00
parent 5b03b3cef4
commit 7a8df8b9f2
No known key found for this signature in database
GPG Key ID: 50EE40A2809851F5
1 changed files with 2 additions and 3 deletions

View File

@ -183,14 +183,13 @@ 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 prev, err
return "", err
}
cont = strings.TrimSpace(cont)
return prev + strings.TrimSuffix(cont, "\n"), nil
}