fix: move cursor to end of line on history search (closes #121)

pull/128/head
TorchedSammy 2022-03-21 06:47:14 -04:00
parent 754a63c74b
commit f27d60f827
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 4 additions and 0 deletions

View File

@ -626,6 +626,8 @@ func (rl *Instance) escapeSeq(r []rune) {
} }
rl.mainHist = true rl.mainHist = true
rl.walkHistory(1) rl.walkHistory(1)
moveCursorForwards(len(rl.line) - rl.pos)
rl.pos = len(rl.line)
case seqDown: case seqDown:
if rl.modeTabCompletion { if rl.modeTabCompletion {
@ -637,6 +639,8 @@ func (rl *Instance) escapeSeq(r []rune) {
} }
rl.mainHist = true rl.mainHist = true
rl.walkHistory(-1) rl.walkHistory(-1)
moveCursorForwards(len(rl.line) - rl.pos)
rl.pos = len(rl.line)
case seqForwards: case seqForwards:
if rl.modeTabCompletion { if rl.modeTabCompletion {