This commit is contained in:
Justin M. Keyes
2018-02-12 01:32:52 +01:00
parent c68d89521f
commit 7da4d1561b
4 changed files with 52 additions and 44 deletions

View File

@@ -5987,7 +5987,7 @@ static void ex_quit(exarg_T *eap)
}
// If there are more files or windows we won't exit.
if (check_more(FALSE, eap->forceit) == OK && only_one_window()) {
if (check_more(false, eap->forceit) == OK && only_one_window()) {
exiting = true;
}
if ((!buf_hide(wp->w_buffer)
@@ -6007,7 +6007,7 @@ static void ex_quit(exarg_T *eap)
if (only_one_window() && (ONE_WINDOW || eap->addr_count == 0)) {
getout(0);
}
/* close window; may free buffer */
// close window; may free buffer
win_close(wp, !buf_hide(wp->w_buffer) || eap->forceit);
}
}
@@ -6123,11 +6123,12 @@ ex_win_close (
}
/* free buffer when not hiding it or when it's a scratch buffer */
if (tp == NULL)
// free buffer when not hiding it or when it's a scratch buffer
if (tp == NULL) {
win_close(win, !need_hide && !buf_hide(buf));
else
} else {
win_close_othertab(win, !need_hide && !buf_hide(buf), tp);
}
}
/*
@@ -6928,15 +6929,14 @@ do_exedit (
empty buffer */
setpcmark();
if (do_ecmd(0, (eap->cmdidx == CMD_enew ? NULL : eap->arg),
NULL, eap,
eap->do_ecmd_lnum,
(buf_hide(curbuf) ? ECMD_HIDE : 0)
+ (eap->forceit ? ECMD_FORCEIT : 0)
// After a split we can use an existing buffer.
+ (old_curwin != NULL ? ECMD_OLDBUF : 0)
+ (eap->cmdidx == CMD_badd ? ECMD_ADDBUF : 0 )
, old_curwin == NULL ? curwin : NULL) == FAIL) {
/* Editing the file failed. If the window was split, close it. */
NULL, eap, eap->do_ecmd_lnum,
(buf_hide(curbuf) ? ECMD_HIDE : 0)
+ (eap->forceit ? ECMD_FORCEIT : 0)
// After a split we can use an existing buffer.
+ (old_curwin != NULL ? ECMD_OLDBUF : 0)
+ (eap->cmdidx == CMD_badd ? ECMD_ADDBUF : 0)
, old_curwin == NULL ? curwin : NULL) == FAIL) {
// Editing the file failed. If the window was split, close it.
if (old_curwin != NULL) {
need_hide = (curbufIsChanged() && curbuf->b_nwindows <= 1);
if (!need_hide || buf_hide(curbuf)) {