mirror of https://github.com/Hilbis/Hilbish
fix(readline): home and end buttons not putting the cursor in the right place
parent
4e8aa7ed1d
commit
1e48a3e03d
|
@ -689,8 +689,7 @@ func (rl *Instance) escapeSeq(r []rune) {
|
||||||
}
|
}
|
||||||
if (rl.modeViMode == VimInsert && rl.pos < len(rl.line)) ||
|
if (rl.modeViMode == VimInsert && rl.pos < len(rl.line)) ||
|
||||||
(rl.modeViMode != VimInsert && rl.pos < len(rl.line)-1) {
|
(rl.modeViMode != VimInsert && rl.pos < len(rl.line)-1) {
|
||||||
moveCursorForwards(1)
|
rl.moveCursorByAdjust(1)
|
||||||
rl.pos++
|
|
||||||
}
|
}
|
||||||
rl.updateHelpers()
|
rl.updateHelpers()
|
||||||
rl.viUndoSkipAppend = true
|
rl.viUndoSkipAppend = true
|
||||||
|
@ -705,10 +704,7 @@ func (rl *Instance) escapeSeq(r []rune) {
|
||||||
rl.renderHelpers()
|
rl.renderHelpers()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if rl.pos > 0 {
|
rl.moveCursorByAdjust(-1)
|
||||||
moveCursorBackwards(1)
|
|
||||||
rl.pos--
|
|
||||||
}
|
|
||||||
rl.viUndoSkipAppend = true
|
rl.viUndoSkipAppend = true
|
||||||
rl.updateHelpers()
|
rl.updateHelpers()
|
||||||
|
|
||||||
|
@ -749,16 +745,16 @@ func (rl *Instance) escapeSeq(r []rune) {
|
||||||
if rl.modeTabCompletion {
|
if rl.modeTabCompletion {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
moveCursorBackwards(rl.pos)
|
rl.moveCursorByAdjust(-rl.pos)
|
||||||
rl.pos = 0
|
rl.updateHelpers()
|
||||||
rl.viUndoSkipAppend = true
|
rl.viUndoSkipAppend = true
|
||||||
|
|
||||||
case seqEnd, seqEndSc:
|
case seqEnd, seqEndSc:
|
||||||
if rl.modeTabCompletion {
|
if rl.modeTabCompletion {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
moveCursorForwards(len(rl.line) - rl.pos)
|
rl.moveCursorByAdjust(len(rl.line) - rl.pos)
|
||||||
rl.pos = len(rl.line)
|
rl.updateHelpers()
|
||||||
rl.viUndoSkipAppend = true
|
rl.viUndoSkipAppend = true
|
||||||
|
|
||||||
case seqAltB:
|
case seqAltB:
|
||||||
|
|
Loading…
Reference in New Issue