diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-06-05 13:31:56 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-06-05 13:31:56 +0200 |
commit | 9472eec83c3f9c191814dc81dd82498c10b1fc9c (patch) | |
tree | 64840015e0e2af07c914321b24bef3005d3f84a3 /src | |
parent | bb7943b7920ef2f88cb9b6f46c34c7946c370819 (diff) | |
download | vim-git-9472eec83c3f9c191814dc81dd82498c10b1fc9c.tar.gz |
patch 8.0.0619: GUI gets stuck if timer uses feedkeys()v8.0.0619
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui.c | 13 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 11 insertions, 4 deletions
@@ -2849,6 +2849,10 @@ gui_insert_lines(int row, int count) } } +/* + * Returns OK if a character was found to be available within the given time, + * or FAIL otherwise. + */ static int gui_wait_for_chars_or_timer(long wtime) { @@ -2869,16 +2873,16 @@ gui_wait_for_chars_or_timer(long wtime) if (typebuf.tb_change_cnt != tb_change_cnt) { /* timer may have used feedkeys() */ - return FALSE; + return FAIL; } if (due_time <= 0 || (wtime > 0 && due_time > remaining)) due_time = remaining; if (gui_mch_wait_for_chars(due_time)) - return TRUE; + return OK; if (wtime > 0) remaining -= due_time; } - return FALSE; + return FAIL; #else return gui_mch_wait_for_chars(wtime); #endif @@ -2896,6 +2900,7 @@ gui_wait_for_chars_or_timer(long wtime) gui_wait_for_chars(long wtime) { int retval; + int tb_change_cnt = typebuf.tb_change_cnt; #ifdef FEAT_MENU /* @@ -2953,7 +2958,7 @@ gui_wait_for_chars(long wtime) } #endif - if (retval == FAIL) + if (retval == FAIL && typebuf.tb_change_cnt == tb_change_cnt) { /* Blocking wait. */ before_blocking(); diff --git a/src/version.c b/src/version.c index fa8b538a8..3d9149532 100644 --- a/src/version.c +++ b/src/version.c @@ -765,6 +765,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 619, +/**/ 618, /**/ 617, |