summaryrefslogtreecommitdiffstats
path: root/src/gui.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-04-20 20:18:23 +0200
committerBram Moolenaar <Bram@vim.org>2016-04-20 20:18:23 +0200
commit40b1b5443c88fab77f1f7c6f9e801f7ffdb7e0a8 (patch)
tree59056726cfbcd9afe1b71eab0db0f30ac61856f4 /src/gui.c
parent245c41070c7f37d52be43cce0cb140bd3ade6c7e (diff)
patch 7.4.1759v7.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/gui.c')
-rw-r--r--src/gui.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui.c b/src/gui.c
index 8999f793ff..d747d81179 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -2855,6 +2855,7 @@ gui_wait_for_chars_or_timer(long wtime)
#ifdef FEAT_TIMERS
int due_time;
long remaining = wtime;
+ int tb_change_cnt = typebuf.tb_change_cnt;
/* When waiting very briefly don't trigger timers. */
if (wtime >= 0 && wtime < 10L)
@@ -2865,6 +2866,11 @@ gui_wait_for_chars_or_timer(long wtime)
/* Trigger timers and then get the time in wtime 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 || (wtime > 0 && due_time > remaining))
due_time = remaining;
if (gui_mch_wait_for_chars(due_time))