From 9a665ba296bfe0e96d9f72d9f50b956e210e50c2 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 22 May 2014 18:59:58 +0200 Subject: updated for version 7.4.306 Problem: getchar(0) does not return Esc. Solution: Do not wait for an Esc sequence to be complete. (Yasuhiro Matsumoto) --- src/eval.c | 5 +++-- src/getchar.c | 2 +- src/version.c | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/eval.c b/src/eval.c index bc7f22ad7..3d3c8b4c7 100644 --- a/src/eval.c +++ b/src/eval.c @@ -11313,13 +11313,14 @@ f_getchar(argvars, 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/getchar.c b/src/getchar.c index b39e64d97..c4ffb4b16 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -1883,7 +1883,7 @@ vpeekc_nomap() } #endif -#if defined(FEAT_INS_EXPAND) || defined(PROTO) +#if defined(FEAT_INS_EXPAND) || defined(FEAT_EVAL) || defined(PROTO) /* * Check if any character is available, also half an escape sequence. * Trick: when no typeahead found, but there is something in the typeahead diff --git a/src/version.c b/src/version.c index fcf412796..de58cbd7d 100644 --- a/src/version.c +++ b/src/version.c @@ -734,6 +734,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 306, /**/ 305, /**/ -- cgit v1.2.1