Fix input
This commit is contained in:
parent
6a94165e54
commit
b127f92566
@ -85,6 +85,7 @@ func input_str(env *environment.Env) string {
|
||||
}
|
||||
switch r_rune {
|
||||
case 3: // ^C
|
||||
fmt.Println("^C")
|
||||
input = ""
|
||||
case 4: // ^D
|
||||
input = "exit"
|
||||
@ -95,10 +96,11 @@ func input_str(env *environment.Env) string {
|
||||
input = env.History[history_index]
|
||||
}
|
||||
case 66: // DOWN
|
||||
if history_index < len(env.History)-1 {
|
||||
if history_index < len(env.History)-2 {
|
||||
history_index++
|
||||
input = env.History[history_index]
|
||||
} else {
|
||||
history_index = len(env.History)-1
|
||||
input = ""
|
||||
}
|
||||
case 67: // LEFT
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user