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
This commit is contained in:
Will Stamper 2014-06-13 22:08:04 -05:00 committed by Justin M. Keyes
parent fdeb132cad
commit 1cdd4ff7f6
2 changed files with 4 additions and 3 deletions

View File

@ -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;

View File

@ -212,7 +212,7 @@ static int included_patches[] = {
//309,
//308,
//307,
//306,
306,
//305,
//304,
303,