summaryrefslogtreecommitdiff
path: root/src/os_win32.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-12-11 22:57:40 +0100
committerBram Moolenaar <Bram@vim.org>2019-12-11 22:57:40 +0100
commit36698e34aacee4186e6f5f87f431626752fcb337 (patch)
tree327b6df7cb2df8062e2d28ca12ce54459f34b96d /src/os_win32.c
parente24437b643650cd51d402bd9c603f941fa0cc1a1 (diff)
downloadvim-git-36698e34aacee4186e6f5f87f431626752fcb337.tar.gz
patch 8.1.2424: MS-Windows: console buffer is resized unnecessarilyv8.1.2424
Problem: MS-Windows: console buffer is resized unnecessarily. Solution: Only call ResizeConBuf() when the size differs. (Nobuhiro Takasaki, closes #5343)
Diffstat (limited to 'src/os_win32.c')
-rw-r--r--src/os_win32.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/os_win32.c b/src/os_win32.c
index b56033cac..c5670afd3 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -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