1
0
forked from aniani/vim

patch 8.1.1003: playing back recorded key sequence mistakes key code

Problem:    Playing back recorded key sequence mistakes key code.
Solution:   Insert a <Nop> after the <Esc>. (closes #4068)
This commit is contained in:
Bram Moolenaar
2019-03-10 09:41:51 +01:00
parent cbef8e1aa1
commit 6edbbd8114
3 changed files with 27 additions and 0 deletions

View File

@@ -2913,6 +2913,17 @@ vgetorpeek(int advance)
if (gui.in_use && shape_changed)
gui_update_cursor(TRUE, FALSE);
#endif
if (timedout && c == ESC)
{
char_u nop_buf[3];
// When recording there will be no timeout. Add a <Nop> after the ESC
// to avoid that it forms a key code with following characters.
nop_buf[0] = K_SPECIAL;
nop_buf[1] = KS_EXTRA;
nop_buf[2] = KE_NOP;
gotchars(nop_buf, 3);
}
--vgetc_busy;