summaryrefslogtreecommitdiff
path: root/src/eval.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2014-05-22 18:59:58 +0200
committerBram Moolenaar <Bram@vim.org>2014-05-22 18:59:58 +0200
commit9a665ba296bfe0e96d9f72d9f50b956e210e50c2 (patch)
tree258226bfe2c59d3d7b7a6dad241cb3fc78f1b75c /src/eval.c
parent13600303c539816933e8b74d14cc518b00f250f8 (diff)
downloadvim-git-9a665ba296bfe0e96d9f72d9f50b956e210e50c2.tar.gz
updated for version 7.4.306v7.4.306
Problem: getchar(0) does not return Esc. Solution: Do not wait for an Esc sequence to be complete. (Yasuhiro Matsumoto)
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c5
1 files changed, 3 insertions, 2 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;