From 1cdd4ff7f6ea2a6430ab96885bdbc98b23d619f0 Mon Sep 17 00:00:00 2001 From: Will Stamper Date: Fri, 13 Jun 2014 22:08:04 -0500 Subject: vim-patch:7.4.306 #842 Problem: getchar(0) does not return Esc. Solution: Do not wait for an Esc sequence to be complete. (Yasuhiro Matsumoto) https://code.google.com/p/vim/source/detail?r=05e1d8afcc5e375bf708ccc9810e2fd1a5a8a3cf --- src/nvim/eval.c | 5 +++-- src/nvim/version.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 88f4765f54..8db50d6517 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -8989,13 +8989,14 @@ static void f_getchar(typval_T *argvars, typval_T *rettv) n = safe_vgetc(); else if (get_tv_number_chk(&argvars[0], &error) == 1) /* getchar(1): only check if char avail */ - n = vpeekc(); - else if (error || vpeekc() == NUL) + n = vpeekc_any(); + else if (error || vpeekc_any() == NUL) /* illegal argument or getchar(0) and no char avail: return zero */ n = 0; else /* getchar(0) and char avail: return char */ n = safe_vgetc(); + if (n == K_IGNORE) continue; break; diff --git a/src/nvim/version.c b/src/nvim/version.c index f1ce7f6ab2..6629640b45 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -212,7 +212,7 @@ static int included_patches[] = { //309, //308, //307, - //306, + 306, //305, //304, 303, -- cgit