From 491a3210a9b8e67fc91817659fda27585a25e4e1 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sun, 16 Jun 2019 19:48:46 +0200 Subject: vim-patch:8.1.1003: playing back recorded key sequence mistakes key code (#10155) Problem: Playing back recorded key sequence mistakes key code. Solution: Insert a after the . (closes vim/vim#4068) https://github.com/vim/vim/commit/6edbbd8114320089c0e603e033775d9dd34cb10a --- src/nvim/getchar.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/nvim/getchar.c') diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index 7e4a0e1321..277af74897 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -2342,6 +2342,17 @@ static int vgetorpeek(int advance) } } + if (timedout && c == ESC) { + char_u nop_buf[3]; + + // When recording there will be no timeout. Add a 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; return c; -- cgit