changeset 17409:e24bbd061233 v8.1.1703

patch 8.1.1703: breaking out of loop by checking window pointer insufficient commit https://github.com/vim/vim/commit/61386408063a2300d7d7f42c5156f66f6252fb54 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jul 16 21:19:55 2019 +0200 patch 8.1.1703: breaking out of loop by checking window pointer insufficient Problem: Breaking out of loop by checking window pointer is insufficient. Solution: Check the window ID and the buffer number. (closes https://github.com/vim/vim/issues/4683)
author Bram Moolenaar <Bram@vim.org>
date Tue, 16 Jul 2019 21:30:05 +0200
parents daac0d4d56d0
children 5f5c552c1acb
files src/misc2.c src/version.c
diffstat 2 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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
--- a/src/version.c
+++ b/src/version.c
@@ -778,6 +778,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1703,
+/**/
     1702,
 /**/
     1701,