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