]> granicus.if.org Git - vim/commitdiff
patch 8.1.2424: MS-Windows: console buffer is resized unnecessarily v8.1.2424
authorBram Moolenaar <Bram@vim.org>
Wed, 11 Dec 2019 21:57:40 +0000 (22:57 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 11 Dec 2019 21:57:40 +0000 (22:57 +0100)
Problem:    MS-Windows: console buffer is resized unnecessarily.
Solution:   Only call ResizeConBuf() when the size differs. (Nobuhiro
            Takasaki, closes #5343)

src/os_win32.c
src/version.c

index b56033cac72335a61c4c756a570341be25abbd7c..c5670afd300a7bf9e93a9812f60ed61ca0993e90 100644 (file)
@@ -1641,15 +1641,19 @@ WaitForChar(long msec, int ignore_input)
            {
                COORD dwSize = ir.Event.WindowBufferSizeEvent.dwSize;
 
-               // Only call shell_resized() when the size actually change to
+               // Only call shell_resized() when the size actually changed to
                // avoid the screen is cleared.
                if (dwSize.X != Columns || dwSize.Y != Rows)
                {
                    CONSOLE_SCREEN_BUFFER_INFO csbi;
                    GetConsoleScreenBufferInfo(g_hConOut, &csbi);
+                   dwSize.X = csbi.srWindow.Right - csbi.srWindow.Left + 1;
                    dwSize.Y = csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
-                   ResizeConBuf(g_hConOut, dwSize);
-                   shell_resized();
+                   if (dwSize.X != Columns || dwSize.Y != Rows)
+                   {
+                       ResizeConBuf(g_hConOut, dwSize);
+                       shell_resized();
+                   }
                }
            }
            else if (ir.EventType == MOUSE_EVENT
index 97e303032ebabaa5c515320b2349e20be380e4d3..44020c1c330e4cb732a1fb3ba3951b929ac00cec 100644 (file)
@@ -742,6 +742,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2424,
 /**/
     2423,
 /**/