Mercurial > vim
changeset 18876:44906eff69f9 v8.1.2424
patch 8.1.2424: MS-Windows: console buffer is resized unnecessarily
Commit: https://github.com/vim/vim/commit/36698e34aacee4186e6f5f87f431626752fcb337
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Dec 11 22:57:40 2019 +0100
patch 8.1.2424: MS-Windows: console buffer is resized unnecessarily
Problem: MS-Windows: console buffer is resized unnecessarily.
Solution: Only call ResizeConBuf() when the size differs. (Nobuhiro
Takasaki, closes #5343)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 11 Dec 2019 23:00:04 +0100 |
parents | ba733b6814ed |
children | b56a6c6d1772 |
files | src/os_win32.c src/version.c |
diffstat | 2 files changed, 9 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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