mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 09:18:19 +00:00
fix: close floating windows when calling win_close()
This commit is contained in:
@@ -6619,7 +6619,7 @@ static void ex_quit(exarg_T *eap)
|
||||
}
|
||||
not_exiting();
|
||||
// close window; may free buffer
|
||||
win_close(wp, !buf_hide(wp->w_buffer) || eap->forceit);
|
||||
win_close(wp, !buf_hide(wp->w_buffer) || eap->forceit, eap->forceit);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6734,7 +6734,7 @@ void ex_win_close(int forceit, win_T *win, tabpage_T *tp)
|
||||
|
||||
// free buffer when not hiding it or when it's a scratch buffer
|
||||
if (tp == NULL) {
|
||||
win_close(win, !need_hide && !buf_hide(buf));
|
||||
win_close(win, !need_hide && !buf_hide(buf), forceit);
|
||||
} else {
|
||||
win_close_othertab(win, !need_hide && !buf_hide(buf), tp);
|
||||
}
|
||||
@@ -6898,7 +6898,7 @@ static void ex_hide(exarg_T *eap)
|
||||
// ":hide" or ":hide | cmd": hide current window
|
||||
if (!eap->skip) {
|
||||
if (eap->addr_count == 0) {
|
||||
win_close(curwin, false); // don't free buffer
|
||||
win_close(curwin, false, eap->forceit); // don't free buffer
|
||||
} else {
|
||||
int winnr = 0;
|
||||
win_T *win = NULL;
|
||||
@@ -6913,7 +6913,7 @@ static void ex_hide(exarg_T *eap)
|
||||
if (win == NULL) {
|
||||
win = lastwin;
|
||||
}
|
||||
win_close(win, false);
|
||||
win_close(win, false, eap->forceit);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6971,7 +6971,7 @@ static void ex_exit(exarg_T *eap)
|
||||
}
|
||||
not_exiting();
|
||||
// Quit current window, may free the buffer.
|
||||
win_close(curwin, !buf_hide(curwin->w_buffer));
|
||||
win_close(curwin, !buf_hide(curwin->w_buffer), eap->forceit);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7572,7 +7572,7 @@ void do_exedit(exarg_T *eap, win_T *old_curwin)
|
||||
// Reset the error/interrupt/exception state here so that
|
||||
// aborting() returns FALSE when closing a window.
|
||||
enter_cleanup(&cs);
|
||||
win_close(curwin, !need_hide && !buf_hide(curbuf));
|
||||
win_close(curwin, !need_hide && !buf_hide(curbuf), false);
|
||||
|
||||
// Restore the error/interrupt/exception state if not
|
||||
// discarded by a new aborting error, interrupt, or
|
||||
|
Reference in New Issue
Block a user