Fix the behavior when pressing Ctrl-C on non-empty line
fix unnecessary sm.Event(Waiting)
@@ -113,7 +113,7 @@ reset:
println("")
println("Bye!")
return
- }
+ } else {
// Erasing command buffer
println("")
stack = 0
@@ -123,6 +123,7 @@ reset:
continue
}
}
+ }
switch {
case strings.HasPrefix(line, "#"):
@@ -190,7 +191,6 @@ reset:
if sm.Is(Waiting) && stack > 0 {
println(prompt(stack) + indent(stack) + line)
- sm.Event(Waiting)
rl.SetPrompt(prompt(stack) + indent(stack))
cmds = append(cmds, line)
continue
