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:
parent
5b03b3cef4
commit
7a8df8b9f2
5
main.go
5
main.go
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user