Skip to content

Commit 4af031d

Browse files
committed
patch 8.0.1407: GUI: CursorHold may trigger before 'updatetime'
Problem: GUI: CursorHold may trigger before 'updatetime' when using timers. Solution: Check that 'updatetime' has passed.
1 parent b254af3 commit 4af031d

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

src/gui.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2923,6 +2923,9 @@ gui_wait_for_chars_or_timer(long wtime)
29232923
gui_wait_for_chars(long wtime, int tb_change_cnt)
29242924
{
29252925
int retval;
2926+
#if defined(ELAPSED_FUNC) && defined(FEAT_AUTOCMD)
2927+
ELAPSED_TYPE start_tv;
2928+
#endif
29262929

29272930
#ifdef FEAT_MENU
29282931
/*
@@ -2952,6 +2955,10 @@ gui_wait_for_chars(long wtime, int tb_change_cnt)
29522955
return retval;
29532956
}
29542957

2958+
#if defined(ELAPSED_FUNC) && defined(FEAT_AUTOCMD)
2959+
ELAPSED_INIT(start_tv);
2960+
#endif
2961+
29552962
/*
29562963
* While we are waiting indefinitely for a character, blink the cursor.
29572964
*/
@@ -2966,7 +2973,11 @@ gui_wait_for_chars(long wtime, int tb_change_cnt)
29662973
if (gui_wait_for_chars_or_timer(p_ut) == OK)
29672974
retval = OK;
29682975
#ifdef FEAT_AUTOCMD
2969-
else if (trigger_cursorhold() && typebuf.tb_change_cnt == tb_change_cnt)
2976+
else if (trigger_cursorhold()
2977+
# ifdef ELAPSED_FUNC
2978+
&& ELAPSED_FUNC(start_tv) >= p_ut
2979+
# endif
2980+
&& typebuf.tb_change_cnt == tb_change_cnt)
29702981
{
29712982
char_u buf[3];
29722983

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,8 @@ static char *(features[]) =
771771

772772
static int included_patches[] =
773773
{ /* Add new patch number below this line */
774+
/**/
775+
1407,
774776
/**/
775777
1406,
776778
/**/

0 commit comments

Comments
 (0)