Skip to content

Commit 7a85b0f

Browse files
committed
patch 8.0.0578: :simalt on MS-Windows does not work properly
Problem: :simalt on MS-Windows does not work properly. Solution: Put something in the typeahead buffer. (Christian Brabandt)
1 parent 97db554 commit 7a85b0f

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/gui_w32.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2627,7 +2627,9 @@ gui_mch_set_curtab(int nr)
26272627
void
26282628
ex_simalt(exarg_T *eap)
26292629
{
2630-
char_u *keys = eap->arg;
2630+
char_u *keys = eap->arg;
2631+
int fill_typebuf = FALSE;
2632+
char_u key_name[4];
26312633

26322634
PostMessage(s_hwnd, WM_SYSCOMMAND, (WPARAM)SC_KEYMENU, (LPARAM)0);
26332635
while (*keys)
@@ -2636,6 +2638,18 @@ ex_simalt(exarg_T *eap)
26362638
*keys = ' '; /* for showing system menu */
26372639
PostMessage(s_hwnd, WM_CHAR, (WPARAM)*keys, (LPARAM)0);
26382640
keys++;
2641+
fill_typebuf = TRUE;
2642+
}
2643+
if (fill_typebuf)
2644+
{
2645+
/* Put something in the typeahead buffer so that the message will get
2646+
* processed. */
2647+
key_name[0] = K_SPECIAL;
2648+
key_name[1] = KS_EXTRA;
2649+
key_name[2] = KE_IGNORE;
2650+
key_name[3] = NUL;
2651+
typebuf_was_filled = TRUE;
2652+
(void)ins_typebuf(key_name, REMAP_NONE, 0, TRUE, FALSE);
26392653
}
26402654
}
26412655

src/version.c

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

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
578,
767769
/**/
768770
577,
769771
/**/

0 commit comments

Comments
 (0)