mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 15:21:47 +00:00
vim-patch:8.0.0073
Problem: More comparisons between firstwin and lastwin.
Solution: Use ONE_WINDOW for consistency. (Hirohito Higashi)
459ca56312
This commit is contained in:
@@ -574,7 +574,7 @@ int win_split_ins(int size, int flags, win_T *new_wp, int dir)
|
||||
oldwin = curwin;
|
||||
|
||||
/* add a status line when p_ls == 1 and splitting the first window */
|
||||
if (lastwin == firstwin && p_ls == 1 && oldwin->w_status_height == 0) {
|
||||
if (ONE_WINDOW && p_ls == 1 && oldwin->w_status_height == 0) {
|
||||
if (oldwin->w_height <= p_wmh && new_wp == NULL) {
|
||||
EMSG(_(e_noroom));
|
||||
return FAIL;
|
||||
@@ -1182,7 +1182,7 @@ static void win_exchange(long Prenum)
|
||||
win_T *wp2;
|
||||
int temp;
|
||||
|
||||
if (lastwin == firstwin) { /* just one window */
|
||||
if (ONE_WINDOW) { /* just one window */
|
||||
beep_flush();
|
||||
return;
|
||||
}
|
||||
@@ -1343,7 +1343,7 @@ static void win_totop(int size, int flags)
|
||||
int dir;
|
||||
int height = curwin->w_height;
|
||||
|
||||
if (lastwin == firstwin) {
|
||||
if (ONE_WINDOW) {
|
||||
beep_flush();
|
||||
return;
|
||||
}
|
||||
@@ -1728,7 +1728,7 @@ void close_windows(buf_T *buf, int keep_curwin)
|
||||
|
||||
++RedrawingDisabled;
|
||||
|
||||
for (win_T *wp = firstwin; wp != NULL && lastwin != firstwin; ) {
|
||||
for (win_T *wp = firstwin; wp != NULL && !ONE_WINDOW; ) {
|
||||
if (wp->w_buffer == buf && (!keep_curwin || wp != curwin)
|
||||
&& !(wp->w_closing || wp->w_buffer->b_locked > 0)) {
|
||||
if (win_close(wp, false) == FAIL) {
|
||||
@@ -1810,7 +1810,7 @@ static bool close_last_window_tabpage(win_T *win, bool free_buf,
|
||||
tabpage_T *prev_curtab)
|
||||
FUNC_ATTR_NONNULL_ARG(1)
|
||||
{
|
||||
if (firstwin != lastwin) {
|
||||
if (!ONE_WINDOW) {
|
||||
return false;
|
||||
}
|
||||
buf_T *old_curbuf = curbuf;
|
||||
@@ -2851,7 +2851,7 @@ close_others (
|
||||
win_close(wp, !P_HID(wp->w_buffer) && !bufIsChanged(wp->w_buffer));
|
||||
}
|
||||
|
||||
if (message && lastwin != firstwin)
|
||||
if (message && !ONE_WINDOW)
|
||||
EMSG(_("E445: Other window contains changes"));
|
||||
}
|
||||
|
||||
@@ -5173,7 +5173,7 @@ last_status (
|
||||
{
|
||||
/* Don't make a difference between horizontal or vertical split. */
|
||||
last_status_rec(topframe, (p_ls == 2
|
||||
|| (p_ls == 1 && (morewin || lastwin != firstwin))));
|
||||
|| (p_ls == 1 && (morewin || !ONE_WINDOW))));
|
||||
}
|
||||
|
||||
static void last_status_rec(frame_T *fr, int statusline)
|
||||
|
Reference in New Issue
Block a user