fix(window): handle closing the only non-float in other tabpage

Problem: No check for closing the only non-floating window in a non-current
tabpage that contains floats. This can lead to a tabpage that contains only
floats, causing crashes.

Solution: Copy the relevant check from win_close to win_close_othertab. Fix some
uncovered issues.

Closes #34943
Fixes #31236

Co-authored-by: glepnir <glephunter@gmail.com>
This commit is contained in:
Sean Dewar
2025-07-15 23:16:40 +01:00
parent b0e8b0a35f
commit 3a36df9b13
5 changed files with 134 additions and 42 deletions

View File

@@ -374,7 +374,7 @@ void nvim_win_hide(Window window, Error *err)
} else if (tabpage == curtab) {
win_close(win, false, false);
} else {
win_close_othertab(win, false, tabpage);
win_close_othertab(win, false, tabpage, false);
}
});
}