forked from aniani/vim
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)
This commit is contained in:
@@ -1641,17 +1641,21 @@ WaitForChar(long msec, int ignore_input)
|
|||||||
{
|
{
|
||||||
COORD dwSize = ir.Event.WindowBufferSizeEvent.dwSize;
|
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.
|
// avoid the screen is cleared.
|
||||||
if (dwSize.X != Columns || dwSize.Y != Rows)
|
if (dwSize.X != Columns || dwSize.Y != Rows)
|
||||||
{
|
{
|
||||||
CONSOLE_SCREEN_BUFFER_INFO csbi;
|
CONSOLE_SCREEN_BUFFER_INFO csbi;
|
||||||
GetConsoleScreenBufferInfo(g_hConOut, &csbi);
|
GetConsoleScreenBufferInfo(g_hConOut, &csbi);
|
||||||
|
dwSize.X = csbi.srWindow.Right - csbi.srWindow.Left + 1;
|
||||||
dwSize.Y = csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
|
dwSize.Y = csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
|
||||||
|
if (dwSize.X != Columns || dwSize.Y != Rows)
|
||||||
|
{
|
||||||
ResizeConBuf(g_hConOut, dwSize);
|
ResizeConBuf(g_hConOut, dwSize);
|
||||||
shell_resized();
|
shell_resized();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (ir.EventType == MOUSE_EVENT
|
else if (ir.EventType == MOUSE_EVENT
|
||||||
&& decode_mouse_event(&ir.Event.MouseEvent))
|
&& decode_mouse_event(&ir.Event.MouseEvent))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@@ -742,6 +742,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2424,
|
||||||
/**/
|
/**/
|
||||||
2423,
|
2423,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user