From 15183b41c4416b7638cce26de0a9a83e55948bdc Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 5 Sep 2020 19:59:39 +0200 Subject: [PATCH] patch 8.2.1608: Vim9: getchar() test fails with GUI Problem: Vim9: getchar() test fails with GUI. Solution: Avoid that getchar(0) gets stuck on K_IGNORE. --- src/getchar.c | 8 +++++--- src/version.c | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/getchar.c b/src/getchar.c index 4f5ea4639..e42fc332c 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -2044,10 +2044,12 @@ f_getchar(typval_T *argvars, typval_T *rettv) // illegal argument or getchar(0) and no char avail: return zero n = 0; else - // getchar(0) and char avail: return char - n = plain_vgetc(); + // getchar(0) and char avail() != NUL: get a character. + // Note that vpeekc_any() returns K_SPECIAL for K_IGNORE. + n = safe_vgetc(); - if (n == K_IGNORE || n == K_MOUSEMOVE) + if (n == K_IGNORE || n == K_MOUSEMOVE + || n == K_VER_SCROLLBAR || n == K_HOR_SCROLLBAR) continue; break; } diff --git a/src/version.c b/src/version.c index c306c8858..e1cdba6d6 100644 --- a/src/version.c +++ b/src/version.c @@ -754,6 +754,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1608, /**/ 1607, /**/ -- 2.40.0