comparison src/misc2.c @ 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 d3b15a3789e1
children e00d12c085a5
comparison
equal deleted inserted replaced
17408:daac0d4d56d0 17409:e24bbd061233
4440 * it is safe to do so. 4440 * it is safe to do so.
4441 */ 4441 */
4442 void 4442 void
4443 parse_queued_messages(void) 4443 parse_queued_messages(void)
4444 { 4444 {
4445 win_T *old_curwin = curwin; 4445 int old_curwin_id = curwin->w_id;
4446 int old_curbuf_fnum = curbuf->b_fnum;
4446 int i; 4447 int i;
4447 int save_may_garbage_collect = may_garbage_collect; 4448 int save_may_garbage_collect = may_garbage_collect;
4448 4449
4449 // Do not handle messages while redrawing, because it may cause buffers to 4450 // Do not handle messages while redrawing, because it may cause buffers to
4450 // change or be wiped while they are being redrawn. 4451 // change or be wiped while they are being redrawn.
4492 break; 4493 break;
4493 } 4494 }
4494 4495
4495 may_garbage_collect = save_may_garbage_collect; 4496 may_garbage_collect = save_may_garbage_collect;
4496 4497
4497 // If the current window changed we need to bail out of the waiting loop. 4498 // If the current window or buffer changed we need to bail out of the
4498 // E.g. when a job exit callback closes the terminal window. 4499 // waiting loop. E.g. when a job exit callback closes the terminal window.
4499 if (curwin != old_curwin) 4500 if (curwin->w_id != old_curwin_id || curbuf->b_fnum != old_curbuf_fnum)
4500 ins_char_typebuf(K_IGNORE); 4501 ins_char_typebuf(K_IGNORE);
4501 } 4502 }
4502 #endif 4503 #endif
4503 4504
4504 #ifndef PROTO /* proto is defined in vim.h */ 4505 #ifndef PROTO /* proto is defined in vim.h */