Skip to content

Commit 15183b4

Browse files
committed
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.
1 parent 636c5d5 commit 15183b4

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

src/getchar.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2044,10 +2044,12 @@ f_getchar(typval_T *argvars, typval_T *rettv)
20442044
// illegal argument or getchar(0) and no char avail: return zero
20452045
n = 0;
20462046
else
2047-
// getchar(0) and char avail: return char
2048-
n = plain_vgetc();
2047+
// getchar(0) and char avail() != NUL: get a character.
2048+
// Note that vpeekc_any() returns K_SPECIAL for K_IGNORE.
2049+
n = safe_vgetc();
20492050

2050-
if (n == K_IGNORE || n == K_MOUSEMOVE)
2051+
if (n == K_IGNORE || n == K_MOUSEMOVE
2052+
|| n == K_VER_SCROLLBAR || n == K_HOR_SCROLLBAR)
20512053
continue;
20522054
break;
20532055
}

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,8 @@ static char *(features[]) =
754754

755755
static int included_patches[] =
756756
{ /* Add new patch number below this line */
757+
/**/
758+
1608,
757759
/**/
758760
1607,
759761
/**/

0 commit comments

Comments
 (0)