summaryrefslogtreecommitdiffstats
path: root/src/getchar.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-03-10 09:41:51 +0100
committerBram Moolenaar <Bram@vim.org>2019-03-10 09:41:51 +0100
commit6edbbd8114320089c0e603e033775d9dd34cb10a (patch)
tree3b1e288ce9d406cd0d497a7e28446c9aa415844d /src/getchar.c
parentcbef8e1aa1f260ffde16491b1678eae53a36cf68 (diff)
patch 8.1.1003: playing back recorded key sequence mistakes key codev8.1.1003
Problem: Playing back recorded key sequence mistakes key code. Solution: Insert a <Nop> after the <Esc>. (closes #4068)
Diffstat (limited to 'src/getchar.c')
-rw-r--r--src/getchar.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/getchar.c b/src/getchar.c
index 4e5c8b68cf..0e9942ba34 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -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;