]> granicus.if.org Git - vim/commitdiff
patch 7.4.1584 v7.4.1584
authorBram Moolenaar <Bram@vim.org>
Thu, 17 Mar 2016 16:58:56 +0000 (17:58 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 17 Mar 2016 16:58:56 +0000 (17:58 +0100)
Problem:    Timers don't work for Win32 console.
Solution:   Add check_due_timer() in WaitForChar().

src/os_win32.c
src/version.c

index d7b563459d8851a43b4c624a0a7104cf1fa4f9ac..627d515dda5465ce5a5d719c6a16492b8d6e72a7 100644 (file)
@@ -214,7 +214,6 @@ static void standend(void);
 static void visual_bell(void);
 static void cursor_visible(BOOL fVisible);
 static DWORD write_chars(char_u *pchBuf, DWORD cbToWrite);
-static WCHAR tgetch(int *pmodifiers, WCHAR *pch2);
 static void create_conin(void);
 static int s_cursor_visible = TRUE;
 static int did_create_conin = FALSE;
@@ -1502,6 +1501,21 @@ WaitForChar(long msec)
                                    && (msec < 0 || (long)dwWaitTime > p_mzq))
                dwWaitTime = p_mzq; /* don't wait longer than 'mzquantum' */
 #endif
+#ifdef FEAT_TIMERS
+           {
+               long    due_time;
+
+               /* When waiting very briefly don't trigger timers. */
+               if (dwWaitTime > 10)
+               {
+                   /* Trigger timers and then get the time in msec until the
+                    * next one is due.  Wait up to that time. */
+                   due_time = check_due_timer();
+                   if (due_time > 0 && dwWaitTime > (DWORD)due_time)
+                       dwWaitTime = due_time;
+               }
+           }
+#endif
 #ifdef FEAT_CLIENTSERVER
            /* Wait for either an event on the console input or a message in
             * the client-server window. */
@@ -1604,7 +1618,7 @@ create_conin(void)
 }
 
 /*
- * Get a keystroke or a mouse event
+ * Get a keystroke or a mouse event, use a blocking wait.
  */
     static WCHAR
 tgetch(int *pmodifiers, WCHAR *pch2)
@@ -6074,7 +6088,7 @@ mch_write(
 
 
 /*
- * Delay for half a second.
+ * Delay for "msec" milliseconds.
  */
 /*ARGSUSED*/
     void
index 20f3e071c05c9418164dce2f761172f45e6b03e8..ae550bcb5d58bcd7d0a06eebf9d575997db324f3 100644 (file)
@@ -748,6 +748,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1584,
 /**/
     1583,
 /**/