mirror of
https://github.com/vim/vim.git
synced 2025-07-25 10:54:51 -04:00
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.
This commit is contained in:
parent
b254af312d
commit
4af031dbc8
13
src/gui.c
13
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)
|
gui_wait_for_chars(long wtime, int tb_change_cnt)
|
||||||
{
|
{
|
||||||
int retval;
|
int retval;
|
||||||
|
#if defined(ELAPSED_FUNC) && defined(FEAT_AUTOCMD)
|
||||||
|
ELAPSED_TYPE start_tv;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef FEAT_MENU
|
#ifdef FEAT_MENU
|
||||||
/*
|
/*
|
||||||
@ -2952,6 +2955,10 @@ gui_wait_for_chars(long wtime, int tb_change_cnt)
|
|||||||
return retval;
|
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.
|
* 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)
|
if (gui_wait_for_chars_or_timer(p_ut) == OK)
|
||||||
retval = OK;
|
retval = OK;
|
||||||
#ifdef FEAT_AUTOCMD
|
#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];
|
char_u buf[3];
|
||||||
|
|
||||||
|
@ -771,6 +771,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1407,
|
||||||
/**/
|
/**/
|
||||||
1406,
|
1406,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user