Skip to content

Commit feeb4d0

Browse files
committed
patch 8.0.1371: Shift-Insert doesn't always work in MS-Windows console
Problem: Shift-Insert doesn't always work in MS-Windows console. Solution: Handle K_NUL differently if the second character is more than one byte. (Yasuhiro Matsumoto, closes #2381)
1 parent 1eca6f1 commit feeb4d0

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

src/os_win32.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1816,9 +1816,18 @@ mch_inchar(
18161816
typeahead[typeaheadlen] = c;
18171817
if (ch2 != NUL)
18181818
{
1819-
typeahead[typeaheadlen + n] = 3;
1820-
typeahead[typeaheadlen + n + 1] = (char_u)ch2;
1821-
n += 2;
1819+
if (c == K_NUL && (ch2 & 0xff00) != 0)
1820+
{
1821+
/* fAnsiKey with modifier keys */
1822+
typeahead[typeaheadlen + n] = (char_u)ch2;
1823+
n++;
1824+
}
1825+
else
1826+
{
1827+
typeahead[typeaheadlen + n] = 3;
1828+
typeahead[typeaheadlen + n + 1] = (char_u)ch2;
1829+
n += 2;
1830+
}
18221831
}
18231832

18241833
/* Use the ALT key to set the 8th bit of the character

src/version.c

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

772772
static int included_patches[] =
773773
{ /* Add new patch number below this line */
774+
/**/
775+
1371,
774776
/**/
775777
1370,
776778
/**/

0 commit comments

Comments
 (0)