Skip to content

Commit 6138640

Browse files
committed
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 #4683)
1 parent c728307 commit 6138640

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

src/misc2.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4442,7 +4442,8 @@ has_non_ascii(char_u *s)
44424442
void
44434443
parse_queued_messages(void)
44444444
{
4445-
win_T *old_curwin = curwin;
4445+
int old_curwin_id = curwin->w_id;
4446+
int old_curbuf_fnum = curbuf->b_fnum;
44464447
int i;
44474448
int save_may_garbage_collect = may_garbage_collect;
44484449

@@ -4494,9 +4495,9 @@ parse_queued_messages(void)
44944495

44954496
may_garbage_collect = save_may_garbage_collect;
44964497

4497-
// If the current window changed we need to bail out of the waiting loop.
4498-
// E.g. when a job exit callback closes the terminal window.
4499-
if (curwin != old_curwin)
4498+
// If the current window or buffer changed we need to bail out of the
4499+
// waiting loop. E.g. when a job exit callback closes the terminal window.
4500+
if (curwin->w_id != old_curwin_id || curbuf->b_fnum != old_curbuf_fnum)
45004501
ins_char_typebuf(K_IGNORE);
45014502
}
45024503
#endif

src/version.c

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

778778
static int included_patches[] =
779779
{ /* Add new patch number below this line */
780+
/**/
781+
1703,
780782
/**/
781783
1702,
782784
/**/

0 commit comments

Comments
 (0)