summaryrefslogtreecommitdiff
path: root/src/gui.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-12-19 10:02:43 +0100
committerBram Moolenaar <Bram@vim.org>2017-12-19 10:02:43 +0100
commit4af031dbc8d62f89c94072a406f6d2ec0e5200be (patch)
tree8a801467610e98143f5c1d5af76718da67b3b47b /src/gui.c
parentb254af312d1696b12367085acfbe41a41b7f1ea5 (diff)
downloadvim-git-4af031dbc8d62f89c94072a406f6d2ec0e5200be.tar.gz
patch 8.0.1407: GUI: CursorHold may trigger before 'updatetime'v8.0.1407
Problem: GUI: CursorHold may trigger before 'updatetime' when using timers. Solution: Check that 'updatetime' has passed.
Diffstat (limited to 'src/gui.c')
-rw-r--r--src/gui.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/gui.c b/src/gui.c
index 7026a11d0..916c9befc 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -2923,6 +2923,9 @@ gui_wait_for_chars_or_timer(long wtime)
gui_wait_for_chars(long wtime, int tb_change_cnt)
{
int retval;
+#if defined(ELAPSED_FUNC) && defined(FEAT_AUTOCMD)
+ ELAPSED_TYPE start_tv;
+#endif
#ifdef FEAT_MENU
/*
@@ -2952,6 +2955,10 @@ gui_wait_for_chars(long wtime, int tb_change_cnt)
return retval;
}
+#if defined(ELAPSED_FUNC) && defined(FEAT_AUTOCMD)
+ ELAPSED_INIT(start_tv);
+#endif
+
/*
* While we are waiting indefinitely for a character, blink the cursor.
*/
@@ -2966,7 +2973,11 @@ gui_wait_for_chars(long wtime, int tb_change_cnt)
if (gui_wait_for_chars_or_timer(p_ut) == OK)
retval = OK;
#ifdef FEAT_AUTOCMD
- else if (trigger_cursorhold() && typebuf.tb_change_cnt == tb_change_cnt)
+ else if (trigger_cursorhold()
+# ifdef ELAPSED_FUNC
+ && ELAPSED_FUNC(start_tv) >= p_ut
+# endif
+ && typebuf.tb_change_cnt == tb_change_cnt)
{
char_u buf[3];