changeset 23060:ab8a9b9bd349 v8.2.2076

patch 8.2.2076: MS-Windows console: sometimes drops typed characters Commit: https://github.com/vim/vim/commit/c478ee3d83fab0dba46740f2023c35f743f88316 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Dec 1 21:27:51 2020 +0100 patch 8.2.2076: MS-Windows console: sometimes drops typed characters Problem: MS-Windows console: sometimes drops typed characters. Solution: Do not wait longer than 10 msec for input. (issue https://github.com/vim/vim/issues/7164)
author Bram Moolenaar <Bram@vim.org>
date Tue, 01 Dec 2020 21:30:04 +0100
parents 6a5d5797613f
children b3adc3982d17
files src/os_win32.c src/version.c
diffstat 2 files changed, 9 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -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
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2076,
+/**/
     2075,
 /**/
     2074,