mirror of https://github.com/Hilbis/Hilbish
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
parent
5b03b3cef4
commit
7a8df8b9f2
5
main.go
5
main.go
|
@ -183,14 +183,13 @@ func main() {
|
||||||
func ContinuePrompt(prev string) (string, error) {
|
func ContinuePrompt(prev string) (string, error) {
|
||||||
hooks.Em.Emit("multiline", nil)
|
hooks.Em.Emit("multiline", nil)
|
||||||
lr.SetPrompt(multilinePrompt)
|
lr.SetPrompt(multilinePrompt)
|
||||||
|
|
||||||
cont, err := lr.Read()
|
cont, err := lr.Read()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("")
|
fmt.Println("")
|
||||||
return prev, err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
cont = strings.TrimSpace(cont)
|
cont = strings.TrimSpace(cont)
|
||||||
|
|
||||||
return prev + strings.TrimSuffix(cont, "\n"), nil
|
return prev + strings.TrimSuffix(cont, "\n"), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue