]> granicus.if.org Git - vim/commitdiff
patch 8.2.0647: MS-Windows: repeat count for events was not used v8.2.0647
authorBram Moolenaar <Bram@vim.org>
Sun, 26 Apr 2020 17:00:07 +0000 (19:00 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 26 Apr 2020 17:00:07 +0000 (19:00 +0200)
Problem:    MS-Windows: repeat count for events was not used.
Solution:   Check the repeat count. (Nobuhiro Takasaki, closes #5989)

src/os_win32.c
src/version.c

index 6b32869756b538ae6df32cc40b3e09b722847e10..85efc52663a9e8311e5e6234efbfb889140630da 100644 (file)
@@ -307,6 +307,7 @@ read_console_input(
     int head;
     int tail;
     int i;
+    static INPUT_RECORD s_irPseudo;
 
     if (nLength == -2)
        return (s_dwMax > 0) ? TRUE : FALSE;
@@ -354,6 +355,19 @@ read_console_input(
        }
     }
 
+    if (s_irCache[s_dwIndex].EventType == KEY_EVENT)
+    {
+       if (s_irCache[s_dwIndex].Event.KeyEvent.wRepeatCount > 1)
+       {
+           s_irPseudo = s_irCache[s_dwIndex];
+           s_irPseudo.Event.KeyEvent.wRepeatCount = 1;
+           s_irCache[s_dwIndex].Event.KeyEvent.wRepeatCount--;
+           *lpBuffer = s_irPseudo;
+           *lpEvents = 1;
+           return TRUE;
+       }
+    }
+
     *lpBuffer = s_irCache[s_dwIndex];
     if (!(nLength == -1 || nLength == -2) && ++s_dwIndex >= s_dwMax)
        s_dwMax = 0;
index 16145f2d67b4f82d97632a04808344c36643d6ea..9323b1d09de580550bc8d3faf5216a87682ef1fa 100644 (file)
@@ -746,6 +746,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    647,
 /**/
     646,
 /**/