fix(window): close floats first when closing buffer in other tab (#20284)

This commit is contained in:
zeertzjq
2022-09-22 20:25:34 +08:00
committed by GitHub
parent a7f6f0e2dd
commit 2083c1771a
2 changed files with 7 additions and 1 deletions

View File

@@ -2464,7 +2464,8 @@ void close_windows(buf_T *buf, bool keep_curwin)
for (tp = first_tabpage; tp != NULL; tp = nexttp) {
nexttp = tp->tp_next;
if (tp != curtab) {
FOR_ALL_WINDOWS_IN_TAB(wp, tp) {
// Start from tp_lastwin to close floating windows with the same buffer first.
for (win_T *wp = tp->tp_lastwin; wp != NULL; wp = wp->w_prev) {
if (wp->w_buffer == buf
&& !(wp->w_closing || wp->w_buffer->b_locked > 0)) {
win_close_othertab(wp, false, tp);