]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.281 v7.4.281
authorBram Moolenaar <Bram@vim.org>
Wed, 7 May 2014 19:14:47 +0000 (21:14 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 7 May 2014 19:14:47 +0000 (21:14 +0200)
Problem:    When a session file has more than one tabpage and 'showtabline' is
            one the positions may be slightly off.
Solution:   Set 'showtabline' to two while positioning windows.

src/ex_docmd.c
src/version.c

index a88cdd56413010c364ddc07f071e18fb72b7b4fe..a7df2c31aaa601791e4113f0b7f4d93357c915cf 100644 (file)
@@ -10290,6 +10290,7 @@ makeopens(fd, dirnow)
     char_u     *sname;
     win_T      *edited_win = NULL;
     int                tabnr;
+    int                restore_stal = FALSE;
     win_T      *tab_firstwin;
     frame_T    *tab_topframe;
     int                cur_arg_idx = 0;
@@ -10398,6 +10399,19 @@ makeopens(fd, dirnow)
     }
 #endif
 
+    /*
+     * When there are two or more tabpages and 'showtabline' is 1 the tabline
+     * will be displayed when creating the next tab.  That resizes the windows
+     * in the first tab, which may cause problems.  Set 'showtabline' to 2
+     * temporarily to avoid that.
+     */
+    if (p_stal == 1 && first_tabpage->tp_next != NULL)
+    {
+       if (put_line(fd, "set stal=2") == FAIL)
+           return FAIL;
+       restore_stal = TRUE;
+    }
+
     /*
      * May repeat putting Windows for each tab, when "tabpages" is in
      * 'sessionoptions'.
@@ -10548,6 +10562,8 @@ makeopens(fd, dirnow)
                || put_eol(fd) == FAIL)
            return FAIL;
     }
+    if (restore_stal && put_line(fd, "set stal=1") == FAIL)
+       return FAIL;
 
     /*
      * Wipe out an empty unnamed buffer we started in.
index 818a8b5c16299daebb4c1737729b7457753b1fbb..6da67a1877d031ba7937f37951c4be19213c4956 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    281,
 /**/
     280,
 /**/