]> granicus.if.org Git - vim/commitdiff
patch 8.2.2076: MS-Windows console: sometimes drops typed characters v8.2.2076
authorBram Moolenaar <Bram@vim.org>
Tue, 1 Dec 2020 20:27:51 +0000 (21:27 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 1 Dec 2020 20:27:51 +0000 (21:27 +0100)
Problem:    MS-Windows console: sometimes drops typed characters.
Solution:   Do not wait longer than 10 msec for input. (issue #7164)

src/os_win32.c
src/version.c

index 60c04632cbbfaab335efbeb630f947b8967a93d5..21b9b01279df0dedebe0b15aa1f7bd8d4186983a 100644 (file)
@@ -1588,26 +1588,14 @@ WaitForChar(long msec, int ignore_input)
        {
            DWORD dwWaitTime = dwEndTime - dwNow;
 
-# ifdef FEAT_JOB_CHANNEL
-           // Check channel while waiting for input.
-           if (dwWaitTime > 100)
-           {
-               dwWaitTime = 100;
-               // If there is readahead then parse_queued_messages() timed out
-               // and we should call it again soon.
-               if (channel_any_readahead())
-                   dwWaitTime = 10;
-           }
-# endif
-# ifdef FEAT_BEVAL_GUI
-           if (p_beval && dwWaitTime > 100)
-               // The 'balloonexpr' may indirectly invoke a callback while
-               // waiting for a character, need to check often.
-               dwWaitTime = 100;
-# endif
+           // Don't wait for more than 11 msec to avoid dropping characters,
+           // check channel while waiting for input and handle a callback from
+           // 'balloonexpr'.
+           if (dwWaitTime > 11)
+               dwWaitTime = 11;
+
 # ifdef FEAT_MZSCHEME
-           if (mzthreads_allowed() && p_mzq > 0
-                                   && (msec < 0 || (long)dwWaitTime > p_mzq))
+           if (mzthreads_allowed() && p_mzq > 0 && (long)dwWaitTime > p_mzq)
                dwWaitTime = p_mzq; // don't wait longer than 'mzquantum'
 # endif
 # ifdef FEAT_TIMERS
index bbbf9f23e62cbd73c24c785afce828eee0fee5e0..251782da26c7f1aa5dd37a31c2ab7251893e8041 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2076,
 /**/
     2075,
 /**/