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

fix: prompt for new input on error with ContinuePrompt

basically, dont disregard the error we get and dont return previous
input. now we try to prompt for new input without running the
previous if the function got an error
This commit is contained in:
sammyette 2021-06-11 18:26:34 -04:00
parent 7a8df8b9f2
commit 419e327d95
No known key found for this signature in database
GPG Key ID: 50EE40A2809851F5

View File

@ -140,6 +140,7 @@ func main() {
os.Exit(0)
}
input:
for interactive {
running = false
@ -162,8 +163,10 @@ func main() {
if strings.HasSuffix(input, "\\") {
for {
input, err = ContinuePrompt(strings.TrimSuffix(input, "\\"))
if err != nil || !strings.HasSuffix(input, "\\") {
if err != nil {
goto input // continue inside nested loop
}
if !strings.HasSuffix(input, "\\") {
break
}
}