fix(readline): make esc escape any vim mode

windows-fixes
TorchedSammy 2022-03-13 14:26:44 -04:00
parent 5a2e3e4700
commit 0113a4e0b4
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 1 additions and 1 deletions

View File

@ -543,7 +543,7 @@ func (rl *Instance) viEscape(r []rune) {
// Sometimes the escape sequence is interleaved with another one,
// but key strokes might be in the wrong order, so we double check
// and escape the Insert mode only if needed.
// and escape the mode only if needed.
if rl.modeViMode == VimInsert && len(r) == 1 && r[0] == 27 {
if len(rl.line) > 0 && rl.pos > 0 {
rl.pos--