diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-09-05 19:59:39 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-09-05 19:59:39 +0200 |
commit | 15183b41c4416b7638cce26de0a9a83e55948bdc (patch) | |
tree | 01997ca18a4947f3c95392f233dbdff99e4aaba2 /src/getchar.c | |
parent | 636c5d5399e1a42e8eb5bcb5fede318438d2347a (diff) |
patch 8.2.1608: Vim9: getchar() test fails with GUIv8.2.1608
Problem: Vim9: getchar() test fails with GUI.
Solution: Avoid that getchar(0) gets stuck on K_IGNORE.
Diffstat (limited to 'src/getchar.c')
-rw-r--r-- | src/getchar.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/getchar.c b/src/getchar.c index 4f5ea46390..e42fc332cc 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; } |