0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.1966: popup becomes current window after closing a terminal window

Problem:    Popup becomes current window after closing a terminal window.
Solution:   When restoring the window after executing autocommands, check that
            the window ID is still the same.  (Naruhiko Nishino,
            closes #7272)
This commit is contained in:
Bram Moolenaar
2020-11-07 16:58:59 +01:00
parent 46f479c756
commit cbcd9cbd77
6 changed files with 62 additions and 22 deletions

View File

@@ -1460,6 +1460,21 @@ win_valid(win_T *win)
return win_valid_popup(win);
}
/*
* Find window "id" in the current tab page.
* Return NULL if not found.
*/
win_T *
win_find_by_id(int id)
{
win_T *wp;
FOR_ALL_WINDOWS(wp)
if (wp->w_id == id)
return wp;
return NULL;
}
/*
* Check if "win" is a pointer to an existing window in any tab page.
*/