2
2
mirror of https://github.com/Hilbis/Hilbish synced 2025-04-02 19:53:23 +00:00

revert: fix: return previous input on continue input error

This reverts commit 5b03b3cef432d64b3100d87c95782f659a97970b.
we shouldn't return this just to fix the panic,
instead just handle the error
This commit is contained in:
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

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
}