summaryrefslogtreecommitdiff
path: root/src/os_win32.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-02-11 16:40:45 +0100
committerBram Moolenaar <Bram@vim.org>2018-02-11 16:40:45 +0100
commitc33ecb291518044f661c5fc10b704fc718321794 (patch)
treef99463271592a66aebeeeb2f005920b72b50b2f6 /src/os_win32.c
parentcdd09aa51a8d34bb384460af4f91026dbff5bf48 (diff)
downloadvim-git-c33ecb291518044f661c5fc10b704fc718321794.tar.gz
patch 8.0.1504: Win32: the screen may be cleared on startupv8.0.1504
Problem: Win32: the screen may be cleared on startup. Solution: Only call shell_resized() when the size actually changed. (Ken Takata, closes #2527)
Diffstat (limited to 'src/os_win32.c')
-rw-r--r--src/os_win32.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/os_win32.c b/src/os_win32.c
index 121ff2aa1..02f87102c 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -1557,7 +1557,13 @@ WaitForChar(long msec, int ignore_input)
if (ir.EventType == FOCUS_EVENT)
handle_focus_event(ir);
else if (ir.EventType == WINDOW_BUFFER_SIZE_EVENT)
- shell_resized();
+ {
+ /* Only call shell_resized() when the size actually change to
+ * avoid the screen is cleard. */
+ if (ir.Event.WindowBufferSizeEvent.dwSize.X != Columns
+ || ir.Event.WindowBufferSizeEvent.dwSize.Y != Rows)
+ shell_resized();
+ }
#ifdef FEAT_MOUSE
else if (ir.EventType == MOUSE_EVENT
&& decode_mouse_event(&ir.Event.MouseEvent))