This commit is contained in:
ckelsel
2017-07-24 07:41:01 +08:00
parent b656159fcf
commit 86f2c473dc
3 changed files with 25 additions and 19 deletions

View File

@@ -1204,7 +1204,7 @@ do_buffer (
while (buf == curbuf while (buf == curbuf
&& !(curwin->w_closing || curwin->w_buffer->b_locked > 0) && !(curwin->w_closing || curwin->w_buffer->b_locked > 0)
&& (!ONE_WINDOW || first_tabpage->tp_next != NULL)) { && (!ONE_WINDOW || first_tabpage->tp_next != NULL)) {
if (win_close(curwin, FALSE) == FAIL) if (win_close(curwin, false) == FAIL)
break; break;
} }
@@ -4428,15 +4428,17 @@ do_arg_all (
continue; continue;
} }
} }
/* don't close last window */ // don't close last window
if (ONE_WINDOW if (ONE_WINDOW
&& (first_tabpage->tp_next == NULL || !had_tab)) && (first_tabpage->tp_next == NULL || !had_tab)) {
use_firstwin = TRUE; use_firstwin = true;
else { } else {
win_close(wp, !P_HID(buf) && !bufIsChanged(buf)); win_close(wp, !P_HID(buf) && !bufIsChanged(buf));
/* check if autocommands removed the next window */ // check if autocommands removed the next window
if (!win_valid(wpnext)) if (!win_valid(wpnext)) {
wpnext = firstwin; /* start all over... */ // start all over...
wpnext = firstwin;
}
} }
} }
} }

View File

@@ -2802,16 +2802,18 @@ void ex_z(exarg_T *eap)
int j; int j;
linenr_T lnum = eap->line2; linenr_T lnum = eap->line2;
/* Vi compatible: ":z!" uses display height, without a count uses // Vi compatible: ":z!" uses display height, without a count uses
* 'scroll' */ // 'scroll'
if (eap->forceit) if (eap->forceit) {
bigness = curwin->w_height; bigness = curwin->w_height;
else if (ONE_WINDOW) } else if (ONE_WINDOW) {
bigness = curwin->w_p_scr * 2; bigness = curwin->w_p_scr * 2;
else } else {
bigness = curwin->w_height - 3; bigness = curwin->w_height - 3;
if (bigness < 1) }
if (bigness < 1) {
bigness = 1; bigness = 1;
}
x = eap->arg; x = eap->arg;
kind = x; kind = x;

View File

@@ -6174,13 +6174,15 @@ static void ex_tabonly(exarg_T *eap)
*/ */
void tabpage_close(int forceit) void tabpage_close(int forceit)
{ {
/* First close all the windows but the current one. If that worked then // First close all the windows but the current one. If that worked then
* close the last window in this tab, that will close it. */ // close the last window in this tab, that will close it.
if (!ONE_WINDOW) if (!ONE_WINDOW) {
close_others(TRUE, forceit); close_others(true, forceit);
if (ONE_WINDOW) }
if (ONE_WINDOW) {
ex_win_close(forceit, curwin, NULL); ex_win_close(forceit, curwin, NULL);
} }
}
/* /*
* Close tab page "tp", which is not the current tab page. * Close tab page "tp", which is not the current tab page.