]> granicus.if.org Git - vim/commitdiff
patch 8.1.1695: Windows 10: crash when cursor is at bottom of terminal v8.1.1695
authorBram Moolenaar <Bram@vim.org>
Mon, 15 Jul 2019 18:37:05 +0000 (20:37 +0200)
committerBram Moolenaar <Bram@vim.org>
Mon, 15 Jul 2019 18:37:05 +0000 (20:37 +0200)
Problem:    Windows 10: crash when cursor is at bottom of terminal.
Solution:   Position the cursor before resizing. (Yasuhiro Matsumoto,
            closes #4679)

src/os_win32.c
src/version.c

index 1b961b22cf9634ca6cae8cdd723b5d86f4c7dc9d..102adb62c18147164f8fa688e2e53812f77f2af2 100644 (file)
@@ -3738,6 +3738,7 @@ ResizeConBufAndWindow(
     CONSOLE_SCREEN_BUFFER_INFO csbi;   /* hold current console buffer info */
     SMALL_RECT     srWindowRect;       /* hold the new console size */
     COORD          coordScreen;
+    COORD          cursor;
     static int     resized = FALSE;
 
 #ifdef MCH_WRITE_DUMP
@@ -3792,6 +3793,11 @@ ResizeConBufAndWindow(
     }
     else
     {
+       // Workaround for a Windows 10 bug
+       cursor.X = srWindowRect.Left;
+       cursor.Y = srWindowRect.Top;
+       SetConsoleCursorPosition(hConsole, cursor);
+
        ResizeConBuf(hConsole, coordScreen);
        ResizeWindow(hConsole, srWindowRect);
        resized = TRUE;
index cca8b5bdd2a05a266782508f99db602aec09398c..a1596153162b60c9576f68710c7574661231fcc5 100644 (file)
@@ -777,6 +777,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1695,
 /**/
     1694,
 /**/