vim-patch:8.2.0422: crash when passing popup window to win_splitmove()

Problem:    Crash when passing popup window to win_splitmove(). (john Devin)
Solution:   Disallow moving a popup window. (closes vim/vim#5816)
0f1563ffee

Add translated test for 8.2.0422 (popup->floating)
This commit is contained in:
Andy K. Massimino
2021-03-18 22:40:18 -04:00
parent b2ec770070
commit 0cec2d39c9
3 changed files with 31 additions and 1 deletions

View File

@@ -1619,6 +1619,23 @@ static void win_init_some(win_T *newp, win_T *oldp)
win_copy_options(oldp, newp);
}
/// Return TRUE if "win" is floating window in the current tab page.
///
/// @param win window to check
bool win_valid_floating(const win_T *win)
FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT
{
if (win == NULL) {
return false;
}
FOR_ALL_WINDOWS_IN_TAB(wp, curtab) {
if (wp == win) {
return wp->w_floating;
}
}
return false;
}
/// Check if "win" is a pointer to an existing window in the current tabpage.
///