diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-04-20 20:18:23 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-04-20 20:18:23 +0200 |
commit | 40b1b5443c88fab77f1f7c6f9e801f7ffdb7e0a8 (patch) | |
tree | 59056726cfbcd9afe1b71eab0db0f30ac61856f4 /src/os_win32.c | |
parent | 245c41070c7f37d52be43cce0cb140bd3ade6c7e (diff) | |
download | vim-40b1b5443c88fab77f1f7c6f9e801f7ffdb7e0a8.zip |
patch 7.4.1759
Problem: When using feedkeys() in a timer the inserted characters are not
used right away.
Solution: Break the wait loop when characters have been added to typebuf.
use this for testing CursorHoldI.
Diffstat (limited to 'src/os_win32.c')
-rw-r--r-- | src/os_win32.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/os_win32.c b/src/os_win32.c index 627d515dd..159905d0b 100644 --- a/src/os_win32.c +++ b/src/os_win32.c @@ -1446,6 +1446,7 @@ WaitForChar(long msec) INPUT_RECORD ir; DWORD cRecords; WCHAR ch, ch2; + int tb_change_cnt = typebuf.tb_change_cnt; if (msec > 0) /* Wait until the specified time has elapsed. */ @@ -1511,6 +1512,11 @@ WaitForChar(long msec) /* Trigger timers and then get the time in msec until the * next one is due. Wait up to that time. */ due_time = check_due_timer(); + if (typebuf.tb_change_cnt != tb_change_cnt) + { + /* timer may have used feedkeys() */ + return FALSE; + } if (due_time > 0 && dwWaitTime > (DWORD)due_time) dwWaitTime = due_time; } |