]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.164 v7.4.164
authorBram Moolenaar <Bram@vim.org>
Wed, 5 Feb 2014 13:02:27 +0000 (14:02 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 5 Feb 2014 13:02:27 +0000 (14:02 +0100)
Problem:    Problem with event handling on Windows 8.
Solution:   Ignore duplicate WINDOW_BUFFER_SIZE_EVENTs. (Nobuhiro Takasaki)

src/os_win32.c
src/version.c

index bfd5f4a2edafd4e1ffc9ec509de00b0b72d9e79c..a468bbe745417b118385569d7b63d9b55ae19040 100644 (file)
@@ -253,6 +253,9 @@ read_console_input(
     static DWORD s_dwIndex = 0;
     static DWORD s_dwMax = 0;
     DWORD dwEvents;
+    int head;
+    int tail;
+    int i;
 
     if (!win8_or_later)
     {
@@ -274,7 +277,29 @@ read_console_input(
            *lpEvents = 0;
            return TRUE;
        }
+
+       if (s_dwMax > 1)
+       {
+           head = 0;
+           tail = s_dwMax - 1;
+           while (head != tail)
+           {
+               if (s_irCache[head].EventType == WINDOW_BUFFER_SIZE_EVENT
+                       && s_irCache[head + 1].EventType
+                                                 == WINDOW_BUFFER_SIZE_EVENT)
+               {
+                   /* Remove duplicate event to avoid flicker. */
+                   for (i = head; i < tail; ++i)
+                       s_irCache[i] = s_irCache[i + 1];
+                   --tail;
+                   continue;
+               }
+               head++;
+           }
+           s_dwMax = tail + 1;
+       }
     }
+
     *lpBuffer = s_irCache[s_dwIndex];
     if (nLength != -1 && ++s_dwIndex >= s_dwMax)
        s_dwMax = 0;
index a6acd9a3685ee5ec13c62810ffee5d8824d3836a..312653ea38377b4b00a98e500a8a9cb74d1cd148 100644 (file)
@@ -738,6 +738,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    164,
 /**/
     163,
 /**/