Skip to content

Commit ed5ab2a

Browse files
committed
patch 8.1.1269: MS-Windows GUI: multibyte chars with a 0x80 byte do not work
Problem: MS-Windows GUI: multibyte chars with a 0x80 byte do not work when compiled with VIMDLL. Solution: Adjust the condition for fixing the input buffer. (Ken Takata, closes #4330)
1 parent 510671a commit ed5ab2a

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

src/getchar.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3095,7 +3095,7 @@ inchar(
30953095

30963096
/*
30973097
* Fix typed characters for use by vgetc() and check_termcode().
3098-
* buf[] must have room to triple the number of bytes!
3098+
* "buf[]" must have room to triple the number of bytes!
30993099
* Returns the new length.
31003100
*/
31013101
int
@@ -3135,14 +3135,15 @@ fix_input_buffer(char_u *buf, int len)
31353135
else
31363136
#endif
31373137
if (p[0] == NUL || (p[0] == K_SPECIAL
3138-
/* timeout may generate K_CURSORHOLD */
3138+
// timeout may generate K_CURSORHOLD
31393139
&& (i < 2 || p[1] != KS_EXTRA || p[2] != (int)KE_CURSORHOLD)
31403140
#if defined(MSWIN) && (!defined(FEAT_GUI) || defined(VIMDLL))
3141+
// Win32 console passes modifiers
3142+
&& (
31413143
# ifdef VIMDLL
3142-
&& !gui.in_use
3144+
gui.in_use ||
31433145
# endif
3144-
/* Win32 console passes modifiers */
3145-
&& (i < 2 || p[1] != KS_MODIFIER)
3146+
(i < 2 || p[1] != KS_MODIFIER))
31463147
#endif
31473148
))
31483149
{
@@ -3154,7 +3155,7 @@ fix_input_buffer(char_u *buf, int len)
31543155
len += 2;
31553156
}
31563157
}
3157-
*p = NUL; /* add trailing NUL */
3158+
*p = NUL; // add trailing NUL
31583159
return len;
31593160
}
31603161

src/version.c

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

768768
static int included_patches[] =
769769
{ /* Add new patch number below this line */
770+
/**/
771+
1269,
770772
/**/
771773
1268,
772774
/**/

0 commit comments

Comments
 (0)