Skip to content

Commit 254cfa9

Browse files
committed
updated for version 7.4.363
Problem: In Windows console typing 0xCE does not work. Solution: Convert 0xCE to K_NUL 3. (Nobuhiro Takasaki et al.)
1 parent a1705f0 commit 254cfa9

File tree

3 files changed

+39
-4
lines changed

3 files changed

+39
-4
lines changed

src/os_win32.c

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ win32_enable_privilege(LPTSTR lpszPrivilege, BOOL bEnable)
619619
return FALSE;
620620
}
621621

622-
tokenPrivileges.PrivilegeCount = 1;
622+
tokenPrivileges.PrivilegeCount = 1;
623623
tokenPrivileges.Privileges[0].Luid = luid;
624624
tokenPrivileges.Privileges[0].Attributes = bEnable ?
625625
SE_PRIVILEGE_ENABLED : 0;
@@ -1785,13 +1785,14 @@ mch_inchar(
17851785
#endif
17861786
{
17871787
int n = 1;
1788+
int conv = FALSE;
17881789

1789-
/* A key may have one or two bytes. */
17901790
typeahead[typeaheadlen] = c;
17911791
if (ch2 != NUL)
17921792
{
1793-
typeahead[typeaheadlen + 1] = ch2;
1794-
++n;
1793+
typeahead[typeaheadlen + 1] = 3;
1794+
typeahead[typeaheadlen + 2] = ch2;
1795+
n += 2;
17951796
}
17961797
#ifdef FEAT_MBYTE
17971798
/* Only convert normal characters, not special keys. Need to
@@ -1800,13 +1801,32 @@ mch_inchar(
18001801
if (input_conv.vc_type != CONV_NONE
18011802
&& (ch2 == NUL || c != K_NUL))
18021803
{
1804+
conv = TRUE;
18031805
typeaheadlen -= unconverted;
18041806
n = convert_input_safe(typeahead + typeaheadlen,
18051807
n + unconverted, TYPEAHEADLEN - typeaheadlen,
18061808
rest == NULL ? &rest : NULL, &restlen);
18071809
}
18081810
#endif
18091811

1812+
if (conv)
1813+
{
1814+
char_u *p = typeahead + typeaheadlen;
1815+
char_u *e = typeahead + TYPEAHEADLEN;
1816+
1817+
while (*p && p < e)
1818+
{
1819+
if (*p == K_NUL)
1820+
{
1821+
++p;
1822+
mch_memmove(p + 1, p, ((size_t)(e - p)) - 1);
1823+
*p = 3;
1824+
++n;
1825+
}
1826+
++p;
1827+
}
1828+
}
1829+
18101830
/* Use the ALT key to set the 8th bit of the character
18111831
* when it's one byte, the 8th bit isn't set yet and not
18121832
* using a double-byte encoding (would become a lead

src/term.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3724,7 +3724,11 @@ add_termcode(name, string, flags)
37243724
return;
37253725
}
37263726

3727+
#if defined(WIN3264) && !defined(FEAT_GUI)
3728+
s = vim_strnsave(string, (int)STRLEN(string) + 1);
3729+
#else
37273730
s = vim_strsave(string);
3731+
#endif
37283732
if (s == NULL)
37293733
return;
37303734

@@ -3734,6 +3738,15 @@ add_termcode(name, string, flags)
37343738
STRMOVE(s, s + 1);
37353739
s[0] = term_7to8bit(string);
37363740
}
3741+
3742+
#if defined(WIN3264) && !defined(FEAT_GUI)
3743+
if (s[0] == K_NUL)
3744+
{
3745+
STRMOVE(s + 1, s);
3746+
s[1] = 3;
3747+
}
3748+
#endif
3749+
37373750
len = (int)STRLEN(s);
37383751

37393752
need_gather = TRUE; /* need to fill termleader[] */

src/version.c

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

735735
static int included_patches[] =
736736
{ /* Add new patch number below this line */
737+
/**/
738+
363,
737739
/**/
738740
362,
739741
/**/

0 commit comments

Comments
 (0)