comparison src/os_win32.c @ 17393:372f2eaa544a v8.1.1695

patch 8.1.1695: Windows 10: crash when cursor is at bottom of terminal commit https://github.com/vim/vim/commit/f49a6922596ea88856da802fe33df953b7d77ecb Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jul 15 20:37:05 2019 +0200 patch 8.1.1695: Windows 10: crash when cursor is at bottom of terminal Problem: Windows 10: crash when cursor is at bottom of terminal. Solution: Position the cursor before resizing. (Yasuhiro Matsumoto, closes #4679)
author Bram Moolenaar <Bram@vim.org>
date Mon, 15 Jul 2019 20:45:06 +0200
parents d4ecdb8a4c58
children 9544335db006
comparison
equal deleted inserted replaced
17392:27714a031226 17393:372f2eaa544a
3736 int ySize) 3736 int ySize)
3737 { 3737 {
3738 CONSOLE_SCREEN_BUFFER_INFO csbi; /* hold current console buffer info */ 3738 CONSOLE_SCREEN_BUFFER_INFO csbi; /* hold current console buffer info */
3739 SMALL_RECT srWindowRect; /* hold the new console size */ 3739 SMALL_RECT srWindowRect; /* hold the new console size */
3740 COORD coordScreen; 3740 COORD coordScreen;
3741 COORD cursor;
3741 static int resized = FALSE; 3742 static int resized = FALSE;
3742 3743
3743 #ifdef MCH_WRITE_DUMP 3744 #ifdef MCH_WRITE_DUMP
3744 if (fdDump) 3745 if (fdDump)
3745 { 3746 {
3790 ResizeWindow(hConsole, srWindowRect); 3791 ResizeWindow(hConsole, srWindowRect);
3791 ResizeConBuf(hConsole, coordScreen); 3792 ResizeConBuf(hConsole, coordScreen);
3792 } 3793 }
3793 else 3794 else
3794 { 3795 {
3796 // Workaround for a Windows 10 bug
3797 cursor.X = srWindowRect.Left;
3798 cursor.Y = srWindowRect.Top;
3799 SetConsoleCursorPosition(hConsole, cursor);
3800
3795 ResizeConBuf(hConsole, coordScreen); 3801 ResizeConBuf(hConsole, coordScreen);
3796 ResizeWindow(hConsole, srWindowRect); 3802 ResizeWindow(hConsole, srWindowRect);
3797 resized = TRUE; 3803 resized = TRUE;
3798 } 3804 }
3799 } 3805 }