summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-07-15 20:37:05 +0200
committerBram Moolenaar <Bram@vim.org>2019-07-15 20:37:05 +0200
commitf49a6922596ea88856da802fe33df953b7d77ecb (patch)
tree8e7cdeda84c065a50b66ef24faa54d18e583f9c7
parent41a82604453080d0011f281532582d3bd360df4a (diff)
downloadvim-git-8.1.1695.tar.gz
patch 8.1.1695: Windows 10: crash when cursor is at bottom of terminalv8.1.1695
Problem: Windows 10: crash when cursor is at bottom of terminal. Solution: Position the cursor before resizing. (Yasuhiro Matsumoto, closes #4679)
-rw-r--r--src/os_win32.c6
-rw-r--r--src/version.c2
2 files changed, 8 insertions, 0 deletions
diff --git a/src/os_win32.c b/src/os_win32.c
index 1b961b22c..102adb62c 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -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;
diff --git a/src/version.c b/src/version.c
index cca8b5bdd..a15961531 100644
--- a/src/version.c
+++ b/src/version.c
@@ -778,6 +778,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1695,
+/**/
1694,
/**/
1693,