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