]> granicus.if.org Git - vim/commitdiff
patch 8.0.0073 v8.0.0073
authorBram Moolenaar <Bram@vim.org>
Thu, 10 Nov 2016 17:16:33 +0000 (18:16 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 10 Nov 2016 17:16:33 +0000 (18:16 +0100)
Problem:    More comparisons between firstwin and lastwin.
Solution:   Use ONE_WINDOW for consistency. (Hirohito Higashi)

src/buffer.c
src/ex_cmds.c
src/ex_docmd.c
src/option.c
src/version.c
src/window.c

index 8b1bceb253ff6aa7390cdb236197aba521046da1..e5d2dde2559ecbf1a3fd1ec1f54a9efcbd26450f 100644 (file)
@@ -1412,7 +1412,7 @@ do_buffer(
 # ifdef FEAT_AUTOCMD
                   && !(curwin->w_closing || curwin->w_buffer->b_locked > 0)
 # endif
-                  && (firstwin != lastwin || first_tabpage->tp_next != NULL))
+                  && (!ONE_WINDOW || first_tabpage->tp_next != NULL))
        {
            if (win_close(curwin, FALSE) == FAIL)
                break;
@@ -5140,7 +5140,7 @@ ex_buffer_all(exarg_T *eap)
                        : wp->w_width != Columns)
                    || (had_tab > 0 && wp != firstwin)
 #endif
-                   ) && firstwin != lastwin
+                   ) && !ONE_WINDOW
 #ifdef FEAT_AUTOCMD
                    && !(wp->w_closing || wp->w_buffer->b_locked > 0)
 #endif
index cb58f24aded04d1a74232ef27208ee5571442327..206ead18527c928bed6f1cbf5de40607e7cf076e 100644 (file)
@@ -4577,7 +4577,7 @@ ex_z(exarg_T *eap)
     if (eap->forceit)
        bigness = curwin->w_height;
 #ifdef FEAT_WINDOWS
-    else if (firstwin != lastwin)
+    else if (!ONE_WINDOW)
        bigness = curwin->w_height - 3;
 #endif
     else
index dcb5cfe04158912301060a0c7a37427657c16473..9ad7d77c50fc2bd97706b7a718659815f78b1afb 100644 (file)
@@ -7488,9 +7488,9 @@ tabpage_close(int forceit)
 {
     /* First close all the windows but the current one.  If that worked then
      * close the last window in this tab, that will close it. */
-    if (lastwin != firstwin)
+    if (!ONE_WINDOW)
        close_others(TRUE, forceit);
-    if (lastwin == firstwin)
+    if (ONE_WINDOW)
        ex_win_close(forceit, curwin, NULL);
 # ifdef FEAT_GUI
     need_mouse_correct = TRUE;
index c32a2a4f0aa7bc31d88b1e1270be2eaa70827ae4..ecfdc40dcab247d5b520d5e7f3672dfe7f18c63b 100644 (file)
@@ -8551,7 +8551,7 @@ set_num_option(
        }
 
        /* Change window height NOW */
-       if (lastwin != firstwin)
+       if (!ONE_WINDOW)
        {
            if (pp == &p_wh && curwin->w_height < p_wh)
                win_setheight((int)p_wh);
@@ -8591,7 +8591,7 @@ set_num_option(
        }
 
        /* Change window width NOW */
-       if (lastwin != firstwin && curwin->w_width < p_wiw)
+       if (!ONE_WINDOW && curwin->w_width < p_wiw)
            win_setwidth((int)p_wiw);
     }
 
@@ -10075,7 +10075,7 @@ istermoption(struct vimoption *p)
 comp_col(void)
 {
 #if defined(FEAT_CMDL_INFO) && defined(FEAT_WINDOWS)
-    int last_has_status = (p_ls == 2 || (p_ls == 1 && firstwin != lastwin));
+    int last_has_status = (p_ls == 2 || (p_ls == 1 && !ONE_WINDOW));
 
     sc_col = 0;
     ru_col = 0;
index ef637a8988ba185ac1abce72a664a98123235cd5..6d125005c7e2a0fb9c667b6bb83f0c97fbba046b 100644 (file)
@@ -764,6 +764,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    73,
 /**/
     72,
 /**/
index 17656d54a443881cef33a3218256b6d4a1c6431c..c4448b77e2f5fad9ab2f79d7557a8f5e976bc4c6 100644 (file)
@@ -791,7 +791,7 @@ win_split_ins(
        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)
        {
@@ -1492,7 +1492,7 @@ win_exchange(long Prenum)
     win_T      *wp2;
     int                temp;
 
-    if (lastwin == firstwin)       /* just one window */
+    if (ONE_WINDOW)        /* just one window */
     {
        beep_flush();
        return;
@@ -1674,7 +1674,7 @@ win_totop(int size, int flags)
     int                dir;
     int                height = curwin->w_height;
 
-    if (lastwin == firstwin)
+    if (ONE_WINDOW)
     {
        beep_flush();
        return;
@@ -2123,7 +2123,7 @@ close_windows(
 
     ++RedrawingDisabled;
 
-    for (wp = firstwin; wp != NULL && lastwin != firstwin; )
+    for (wp = firstwin; wp != NULL && !ONE_WINDOW; )
     {
        if (wp->w_buffer == buf && (!keep_curwin || wp != curwin)
 #ifdef FEAT_AUTOCMD
@@ -3373,7 +3373,7 @@ close_others(
        }
     }
 
-    if (message && lastwin != firstwin)
+    if (message && !ONE_WINDOW)
        EMSG(_("E445: Other window contains changes"));
 }
 
@@ -5971,7 +5971,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