3ef2ca
To: vim_dev@googlegroups.com
3ef2ca
Subject: Patch 7.4.377
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.377
3ef2ca
Problem:    When 'equalalways' is set a split may report "no room" even though
3ef2ca
	    there is plenty of room.
3ef2ca
Solution:   Compute the available room properly. (Yukihiro Nakadaira)
3ef2ca
Files:	    src/window.c
3ef2ca
3ef2ca
3ef2ca
*** ../vim-7.4.376/src/window.c	2014-07-16 23:39:50.251084976 +0200
3ef2ca
--- src/window.c	2014-07-23 15:19:10.491918366 +0200
3ef2ca
***************
3ef2ca
*** 684,690 ****
3ef2ca
      int		available;
3ef2ca
      int		oldwin_height = 0;
3ef2ca
      int		layout;
3ef2ca
!     frame_T	*frp, *curfrp;
3ef2ca
      int		before;
3ef2ca
      int		minheight;
3ef2ca
      int		wmh1;
3ef2ca
--- 684,690 ----
3ef2ca
      int		available;
3ef2ca
      int		oldwin_height = 0;
3ef2ca
      int		layout;
3ef2ca
!     frame_T	*frp, *curfrp, *frp2, *prevfrp;
3ef2ca
      int		before;
3ef2ca
      int		minheight;
3ef2ca
      int		wmh1;
3ef2ca
***************
3ef2ca
*** 730,741 ****
3ef2ca
  	needed = wmw1 + 1;
3ef2ca
  	if (flags & WSP_ROOM)
3ef2ca
  	    needed += p_wiw - wmw1;
3ef2ca
! 	if (p_ea || (flags & (WSP_BOT | WSP_TOP)))
3ef2ca
  	{
3ef2ca
  	    minwidth = frame_minwidth(topframe, NOWIN);
3ef2ca
  	    available = topframe->fr_width;
3ef2ca
  	    needed += minwidth;
3ef2ca
  	}
3ef2ca
  	else
3ef2ca
  	{
3ef2ca
  	    minwidth = frame_minwidth(oldwin->w_frame, NOWIN);
3ef2ca
--- 730,758 ----
3ef2ca
  	needed = wmw1 + 1;
3ef2ca
  	if (flags & WSP_ROOM)
3ef2ca
  	    needed += p_wiw - wmw1;
3ef2ca
! 	if (flags & (WSP_BOT | WSP_TOP))
3ef2ca
  	{
3ef2ca
  	    minwidth = frame_minwidth(topframe, NOWIN);
3ef2ca
  	    available = topframe->fr_width;
3ef2ca
  	    needed += minwidth;
3ef2ca
  	}
3ef2ca
+ 	else if (p_ea)
3ef2ca
+ 	{
3ef2ca
+ 	    minwidth = frame_minwidth(oldwin->w_frame, NOWIN);
3ef2ca
+ 	    prevfrp = oldwin->w_frame;
3ef2ca
+ 	    for (frp = oldwin->w_frame->fr_parent; frp != NULL;
3ef2ca
+ 							frp = frp->fr_parent)
3ef2ca
+ 	    {
3ef2ca
+ 		if (frp->fr_layout == FR_ROW)
3ef2ca
+ 		    for (frp2 = frp->fr_child; frp2 != NULL;
3ef2ca
+ 							frp2 = frp2->fr_next)
3ef2ca
+ 			if (frp2 != prevfrp)
3ef2ca
+ 			    minwidth += frame_minwidth(frp2, NOWIN);
3ef2ca
+ 		prevfrp = frp;
3ef2ca
+ 	    }
3ef2ca
+ 	    available = topframe->fr_width;
3ef2ca
+ 	    needed += minwidth;
3ef2ca
+ 	}
3ef2ca
  	else
3ef2ca
  	{
3ef2ca
  	    minwidth = frame_minwidth(oldwin->w_frame, NOWIN);
3ef2ca
***************
3ef2ca
*** 798,809 ****
3ef2ca
  	needed = wmh1 + STATUS_HEIGHT;
3ef2ca
  	if (flags & WSP_ROOM)
3ef2ca
  	    needed += p_wh - wmh1;
3ef2ca
! 	if (p_ea || (flags & (WSP_BOT | WSP_TOP)))
3ef2ca
  	{
3ef2ca
  	    minheight = frame_minheight(topframe, NOWIN) + need_status;
3ef2ca
  	    available = topframe->fr_height;
3ef2ca
  	    needed += minheight;
3ef2ca
  	}
3ef2ca
  	else
3ef2ca
  	{
3ef2ca
  	    minheight = frame_minheight(oldwin->w_frame, NOWIN) + need_status;
3ef2ca
--- 815,843 ----
3ef2ca
  	needed = wmh1 + STATUS_HEIGHT;
3ef2ca
  	if (flags & WSP_ROOM)
3ef2ca
  	    needed += p_wh - wmh1;
3ef2ca
! 	if (flags & (WSP_BOT | WSP_TOP))
3ef2ca
  	{
3ef2ca
  	    minheight = frame_minheight(topframe, NOWIN) + need_status;
3ef2ca
  	    available = topframe->fr_height;
3ef2ca
  	    needed += minheight;
3ef2ca
  	}
3ef2ca
+ 	else if (p_ea)
3ef2ca
+ 	{
3ef2ca
+ 	    minheight = frame_minheight(oldwin->w_frame, NOWIN) + need_status;
3ef2ca
+ 	    prevfrp = oldwin->w_frame;
3ef2ca
+ 	    for (frp = oldwin->w_frame->fr_parent; frp != NULL;
3ef2ca
+ 							frp = frp->fr_parent)
3ef2ca
+ 	    {
3ef2ca
+ 		if (frp->fr_layout == FR_COL)
3ef2ca
+ 		    for (frp2 = frp->fr_child; frp2 != NULL;
3ef2ca
+ 							frp2 = frp2->fr_next)
3ef2ca
+ 			if (frp2 != prevfrp)
3ef2ca
+ 			    minheight += frame_minheight(frp2, NOWIN);
3ef2ca
+ 		prevfrp = frp;
3ef2ca
+ 	    }
3ef2ca
+ 	    available = topframe->fr_height;
3ef2ca
+ 	    needed += minheight;
3ef2ca
+ 	}
3ef2ca
  	else
3ef2ca
  	{
3ef2ca
  	    minheight = frame_minheight(oldwin->w_frame, NOWIN) + need_status;
3ef2ca
*** ../vim-7.4.376/src/version.c	2014-07-23 13:50:41.839956521 +0200
3ef2ca
--- src/version.c	2014-07-23 15:20:33.227917771 +0200
3ef2ca
***************
3ef2ca
*** 736,737 ****
3ef2ca
--- 736,739 ----
3ef2ca
  {   /* Add new patch number below this line */
3ef2ca
+ /**/
3ef2ca
+     377,
3ef2ca
  /**/
3ef2ca
3ef2ca
-- 
3ef2ca
LARGE MAN:   Who's that then?
3ef2ca
CART DRIVER: (Grudgingly) I dunno, Must be a king.
3ef2ca
LARGE MAN:   Why?
3ef2ca
CART DRIVER: He hasn't got shit all over him.
3ef2ca
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
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    ///