comparison src/window.c @ 16847:f8e28c6ae8ab v8.1.1425

patch 8.1.1425: win_execute() does not set window pointers properly commit https://github.com/vim/vim/commit/89adc3a1371d211f7766f3dbc0975ecb2f862327 Author: Bram Moolenaar <Bram@vim.org> Date: Thu May 30 17:29:40 2019 +0200 patch 8.1.1425: win_execute() does not set window pointers properly Problem: Win_execute() does not set window pointers properly. Solution: Use switch_win_noblock(). Also execute autocommands in a popup window.
author Bram Moolenaar <Bram@vim.org>
date Thu, 30 May 2019 17:30:06 +0200
parents ce04ebdf26b8
children 2b00163053cd
comparison
equal deleted inserted replaced
16846:339949bc111a 16847:f8e28c6ae8ab
6493 win_T *win, 6493 win_T *win,
6494 tabpage_T *tp, 6494 tabpage_T *tp,
6495 int no_display) 6495 int no_display)
6496 { 6496 {
6497 block_autocmds(); 6497 block_autocmds();
6498 return switch_win_noblock(save_curwin, save_curtab, win, tp, no_display);
6499 }
6500
6501 /*
6502 * As switch_win() but without blocking autocommands.
6503 */
6504 int
6505 switch_win_noblock(
6506 win_T **save_curwin,
6507 tabpage_T **save_curtab,
6508 win_T *win,
6509 tabpage_T *tp,
6510 int no_display)
6511 {
6498 *save_curwin = curwin; 6512 *save_curwin = curwin;
6499 if (tp != NULL) 6513 if (tp != NULL)
6500 { 6514 {
6501 *save_curtab = curtab; 6515 *save_curtab = curtab;
6502 if (no_display) 6516 if (no_display)
6522 * When "no_display" is TRUE the display won't be affected, no redraw is 6536 * When "no_display" is TRUE the display won't be affected, no redraw is
6523 * triggered. 6537 * triggered.
6524 */ 6538 */
6525 void 6539 void
6526 restore_win( 6540 restore_win(
6527 win_T *save_curwin UNUSED, 6541 win_T *save_curwin,
6528 tabpage_T *save_curtab UNUSED, 6542 tabpage_T *save_curtab,
6529 int no_display UNUSED) 6543 int no_display)
6544 {
6545 restore_win_noblock(save_curwin, save_curtab, no_display);
6546 unblock_autocmds();
6547 }
6548
6549 /*
6550 * As restore_win() but without unblocking autocommands.
6551 */
6552 void
6553 restore_win_noblock(
6554 win_T *save_curwin,
6555 tabpage_T *save_curtab,
6556 int no_display)
6530 { 6557 {
6531 if (save_curtab != NULL && valid_tabpage(save_curtab)) 6558 if (save_curtab != NULL && valid_tabpage(save_curtab))
6532 { 6559 {
6533 if (no_display) 6560 if (no_display)
6534 { 6561 {
6544 if (win_valid(save_curwin)) 6571 if (win_valid(save_curwin))
6545 { 6572 {
6546 curwin = save_curwin; 6573 curwin = save_curwin;
6547 curbuf = curwin->w_buffer; 6574 curbuf = curwin->w_buffer;
6548 } 6575 }
6549 unblock_autocmds();
6550 } 6576 }
6551 6577
6552 /* 6578 /*
6553 * Make "buf" the current buffer. restore_buffer() MUST be called to undo. 6579 * Make "buf" the current buffer. restore_buffer() MUST be called to undo.
6554 * No autocommands will be executed. Use aucmd_prepbuf() if there are any. 6580 * No autocommands will be executed. Use aucmd_prepbuf() if there are any.