Skip to content

Commit 0e0b3dd

Browse files
committed
patch 7.4.1584
Problem: Timers don't work for Win32 console. Solution: Add check_due_timer() in WaitForChar().
1 parent 597385a commit 0e0b3dd

2 files changed

Lines changed: 19 additions & 3 deletions

File tree

src/os_win32.c

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ static void standend(void);
214214
static void visual_bell(void);
215215
static void cursor_visible(BOOL fVisible);
216216
static DWORD write_chars(char_u *pchBuf, DWORD cbToWrite);
217-
static WCHAR tgetch(int *pmodifiers, WCHAR *pch2);
218217
static void create_conin(void);
219218
static int s_cursor_visible = TRUE;
220219
static int did_create_conin = FALSE;
@@ -1502,6 +1501,21 @@ WaitForChar(long msec)
15021501
&& (msec < 0 || (long)dwWaitTime > p_mzq))
15031502
dwWaitTime = p_mzq; /* don't wait longer than 'mzquantum' */
15041503
#endif
1504+
#ifdef FEAT_TIMERS
1505+
{
1506+
long due_time;
1507+
1508+
/* When waiting very briefly don't trigger timers. */
1509+
if (dwWaitTime > 10)
1510+
{
1511+
/* Trigger timers and then get the time in msec until the
1512+
* next one is due. Wait up to that time. */
1513+
due_time = check_due_timer();
1514+
if (due_time > 0 && dwWaitTime > (DWORD)due_time)
1515+
dwWaitTime = due_time;
1516+
}
1517+
}
1518+
#endif
15051519
#ifdef FEAT_CLIENTSERVER
15061520
/* Wait for either an event on the console input or a message in
15071521
* the client-server window. */
@@ -1604,7 +1618,7 @@ create_conin(void)
16041618
}
16051619

16061620
/*
1607-
* Get a keystroke or a mouse event
1621+
* Get a keystroke or a mouse event, use a blocking wait.
16081622
*/
16091623
static WCHAR
16101624
tgetch(int *pmodifiers, WCHAR *pch2)
@@ -6074,7 +6088,7 @@ mch_write(
60746088

60756089

60766090
/*
6077-
* Delay for half a second.
6091+
* Delay for "msec" milliseconds.
60786092
*/
60796093
/*ARGSUSED*/
60806094
void

src/version.c

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

749749
static int included_patches[] =
750750
{ /* Add new patch number below this line */
751+
/**/
752+
1584,
751753
/**/
752754
1583,
753755
/**/

0 commit comments

Comments
 (0)