Blame SOURCES/7.4.281

22c937
To: vim_dev@googlegroups.com
22c937
Subject: Patch 7.4.281
22c937
Fcc: outbox
22c937
From: Bram Moolenaar <Bram@moolenaar.net>
22c937
Mime-Version: 1.0
22c937
Content-Type: text/plain; charset=UTF-8
22c937
Content-Transfer-Encoding: 8bit
22c937
------------
22c937
22c937
Patch 7.4.281
22c937
Problem:    When a session file has more than one tabpage and 'showtabline' is
22c937
	    one the positions may be slightly off.
22c937
Solution:   Set 'showtabline' to two while positioning windows.
22c937
Files:	    src/ex_docmd.c
22c937
22c937
22c937
*** ../vim-7.4.280/src/ex_docmd.c	2014-04-29 12:15:22.856032651 +0200
22c937
--- src/ex_docmd.c	2014-05-07 21:07:56.249296154 +0200
22c937
***************
22c937
*** 10290,10295 ****
22c937
--- 10290,10296 ----
22c937
      char_u	*sname;
22c937
      win_T	*edited_win = NULL;
22c937
      int		tabnr;
22c937
+     int		restore_stal = FALSE;
22c937
      win_T	*tab_firstwin;
22c937
      frame_T	*tab_topframe;
22c937
      int		cur_arg_idx = 0;
22c937
***************
22c937
*** 10399,10404 ****
22c937
--- 10400,10418 ----
22c937
  #endif
22c937
  
22c937
      /*
22c937
+      * When there are two or more tabpages and 'showtabline' is 1 the tabline
22c937
+      * will be displayed when creating the next tab.  That resizes the windows
22c937
+      * in the first tab, which may cause problems.  Set 'showtabline' to 2
22c937
+      * temporarily to avoid that.
22c937
+      */
22c937
+     if (p_stal == 1 && first_tabpage->tp_next != NULL)
22c937
+     {
22c937
+ 	if (put_line(fd, "set stal=2") == FAIL)
22c937
+ 	    return FAIL;
22c937
+ 	restore_stal = TRUE;
22c937
+     }
22c937
+ 
22c937
+     /*
22c937
       * May repeat putting Windows for each tab, when "tabpages" is in
22c937
       * 'sessionoptions'.
22c937
       * Don't use goto_tabpage(), it may change directory and trigger
22c937
***************
22c937
*** 10548,10553 ****
22c937
--- 10562,10569 ----
22c937
  		|| put_eol(fd) == FAIL)
22c937
  	    return FAIL;
22c937
      }
22c937
+     if (restore_stal && put_line(fd, "set stal=1") == FAIL)
22c937
+ 	return FAIL;
22c937
  
22c937
      /*
22c937
       * Wipe out an empty unnamed buffer we started in.
22c937
*** ../vim-7.4.280/src/version.c	2014-05-07 20:25:30.845273872 +0200
22c937
--- src/version.c	2014-05-07 21:11:24.925297981 +0200
22c937
***************
22c937
*** 736,737 ****
22c937
--- 736,739 ----
22c937
  {   /* Add new patch number below this line */
22c937
+ /**/
22c937
+     281,
22c937
  /**/
22c937
22c937
-- 
22c937
hundred-and-one symptoms of being an internet addict:
22c937
122. You ask if the Netaholics Anonymous t-shirt you ordered can be
22c937
     sent to you via e-mail.
22c937
22c937
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
22c937
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
22c937
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
22c937
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///