Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
06544fa371
@ -85,24 +85,37 @@ func input_str(env *environment.Env) string {
|
||||
}
|
||||
switch r_rune {
|
||||
case 3: // ^C
|
||||
fmt.Println("^C")
|
||||
input = ""
|
||||
case 4: // ^D
|
||||
input = "exit"
|
||||
goto loop_exit
|
||||
case 65: // UPP
|
||||
if history_index > 0 {
|
||||
history_index--
|
||||
input = env.History[history_index]
|
||||
case 27: // UPP
|
||||
if r, _, _ := reader.ReadRune(); r != 91 {
|
||||
break
|
||||
}
|
||||
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 = ""
|
||||
if r, _, _ := reader.ReadRune(); r == 65 { // UPP
|
||||
if history_index > 0 {
|
||||
history_index--
|
||||
input = env.History[history_index]
|
||||
}
|
||||
}
|
||||
if r, _, _ := reader.ReadRune(); r != 66 { //DOWN
|
||||
if history_index < len(env.History)-1 {
|
||||
history_index++
|
||||
input = env.History[history_index]
|
||||
} else {
|
||||
input = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
case 67: // LEFT
|
||||
case 68: // RIGHT
|
||||
case 127: //packspace
|
||||
if len(input) > 0 {
|
||||
input = input[:len(input)-1]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user