Skip to content

Commit 9472eec

Browse files
committed
patch 8.0.0619: GUI gets stuck if timer uses feedkeys()
Problem: In the GUI, when a timer uses feedkeys(), it still waits for an event. (Raymond Ko) Solution: Check tb_change_cnt in one more place.
1 parent bb7943b commit 9472eec

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

src/gui.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2849,6 +2849,10 @@ gui_insert_lines(int row, int count)
28492849
}
28502850
}
28512851

2852+
/*
2853+
* Returns OK if a character was found to be available within the given time,
2854+
* or FAIL otherwise.
2855+
*/
28522856
static int
28532857
gui_wait_for_chars_or_timer(long wtime)
28542858
{
@@ -2869,16 +2873,16 @@ gui_wait_for_chars_or_timer(long wtime)
28692873
if (typebuf.tb_change_cnt != tb_change_cnt)
28702874
{
28712875
/* timer may have used feedkeys() */
2872-
return FALSE;
2876+
return FAIL;
28732877
}
28742878
if (due_time <= 0 || (wtime > 0 && due_time > remaining))
28752879
due_time = remaining;
28762880
if (gui_mch_wait_for_chars(due_time))
2877-
return TRUE;
2881+
return OK;
28782882
if (wtime > 0)
28792883
remaining -= due_time;
28802884
}
2881-
return FALSE;
2885+
return FAIL;
28822886
#else
28832887
return gui_mch_wait_for_chars(wtime);
28842888
#endif
@@ -2896,6 +2900,7 @@ gui_wait_for_chars_or_timer(long wtime)
28962900
gui_wait_for_chars(long wtime)
28972901
{
28982902
int retval;
2903+
int tb_change_cnt = typebuf.tb_change_cnt;
28992904

29002905
#ifdef FEAT_MENU
29012906
/*
@@ -2953,7 +2958,7 @@ gui_wait_for_chars(long wtime)
29532958
}
29542959
#endif
29552960

2956-
if (retval == FAIL)
2961+
if (retval == FAIL && typebuf.tb_change_cnt == tb_change_cnt)
29572962
{
29582963
/* Blocking wait. */
29592964
before_blocking();

src/version.c

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

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
619,
767769
/**/
768770
618,
769771
/**/

0 commit comments

Comments
 (0)