diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-07-16 21:19:55 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-07-16 21:19:55 +0200 |
commit | 61386408063a2300d7d7f42c5156f66f6252fb54 (patch) | |
tree | 683561ee0950f001b8f717af87c6bb2ef50370c3 /src/misc2.c | |
parent | c7283078c318277aa4f52ff514e1dc3dc7fa0c80 (diff) | |
download | vim-git-61386408063a2300d7d7f42c5156f66f6252fb54.tar.gz |
patch 8.1.1703: breaking out of loop by checking window pointer insufficientv8.1.1703
Problem: Breaking out of loop by checking window pointer is insufficient.
Solution: Check the window ID and the buffer number. (closes #4683)
Diffstat (limited to 'src/misc2.c')
-rw-r--r-- | src/misc2.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/misc2.c b/src/misc2.c index 000f043e1..0e41be4f5 100644 --- a/src/misc2.c +++ b/src/misc2.c @@ -4442,7 +4442,8 @@ has_non_ascii(char_u *s) void parse_queued_messages(void) { - win_T *old_curwin = curwin; + int old_curwin_id = curwin->w_id; + int old_curbuf_fnum = curbuf->b_fnum; int i; int save_may_garbage_collect = may_garbage_collect; @@ -4494,9 +4495,9 @@ parse_queued_messages(void) may_garbage_collect = save_may_garbage_collect; - // If the current window changed we need to bail out of the waiting loop. - // E.g. when a job exit callback closes the terminal window. - if (curwin != old_curwin) + // If the current window or buffer changed we need to bail out of the + // waiting loop. E.g. when a job exit callback closes the terminal window. + if (curwin->w_id != old_curwin_id || curbuf->b_fnum != old_curbuf_fnum) ins_char_typebuf(K_IGNORE); } #endif |