0
0
mirror of https://github.com/vim/vim.git synced 2025-10-13 06:54:15 -04:00

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.
This commit is contained in:
Bram Moolenaar
2019-05-30 17:29:40 +02:00
parent 5c3fb04623
commit 89adc3a137
5 changed files with 42 additions and 15 deletions

View File

@@ -6116,19 +6116,18 @@ f_win_execute(typval_T *argvars, typval_T *rettv)
{
int id = (int)tv_get_number(argvars);
win_T *wp = win_id2wp(id);
win_T *save_curwin = curwin;
win_T *save_curwin;
tabpage_T *save_curtab;
if (wp != NULL)
{
curwin = wp;
curbuf = curwin->w_buffer;
check_cursor();
execute_common(argvars, rettv, 1);
if (win_valid(save_curwin))
if (switch_win_noblock(&save_curwin, &save_curtab, wp, curtab, TRUE)
== OK)
{
curwin = save_curwin;
curbuf = curwin->w_buffer;
check_cursor();
execute_common(argvars, rettv, 1);
}
restore_win_noblock(save_curwin, save_curtab, TRUE);
}
}