diff options
author | Bram Moolenaar <bram@vim.org> | 2014-02-05 14:02:27 +0100 |
---|---|---|
committer | Bram Moolenaar <bram@vim.org> | 2014-02-05 14:02:27 +0100 |
commit | 395ead6f30dcb00426c109cb120f7f8bf5678ad2 (patch) | |
tree | 7fbdf21382b3c4669f0a1462d6d6a103272f72ee | |
parent | 0c75dd3ff65a3519871d8e5104d302bfadc51dba (diff) | |
download | vim-7.4.164.tar.gz |
Problem: Problem with event handling on Windows 8.
Solution: Ignore duplicate WINDOW_BUFFER_SIZE_EVENTs. (Nobuhiro Takasaki)
-rw-r--r-- | src/os_win32.c | 25 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 27 insertions, 0 deletions
diff --git a/src/os_win32.c b/src/os_win32.c index bfd5f4a2..a468bbe7 100644 --- a/src/os_win32.c +++ b/src/os_win32.c @@ -253,6 +253,9 @@ read_console_input( static DWORD s_dwIndex = 0; static DWORD s_dwMax = 0; DWORD dwEvents; + int head; + int tail; + int i; if (!win8_or_later) { @@ -274,7 +277,29 @@ read_console_input( *lpEvents = 0; return TRUE; } + + if (s_dwMax > 1) + { + head = 0; + tail = s_dwMax - 1; + while (head != tail) + { + if (s_irCache[head].EventType == WINDOW_BUFFER_SIZE_EVENT + && s_irCache[head + 1].EventType + == WINDOW_BUFFER_SIZE_EVENT) + { + /* Remove duplicate event to avoid flicker. */ + for (i = head; i < tail; ++i) + s_irCache[i] = s_irCache[i + 1]; + --tail; + continue; + } + head++; + } + s_dwMax = tail + 1; + } } + *lpBuffer = s_irCache[s_dwIndex]; if (nLength != -1 && ++s_dwIndex >= s_dwMax) s_dwMax = 0; diff --git a/src/version.c b/src/version.c index a6acd9a3..312653ea 100644 --- a/src/version.c +++ b/src/version.c @@ -739,6 +739,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 164, +/**/ 163, /**/ 162, |