Blob Blame History Raw
To: vim_dev@googlegroups.com
Subject: Patch 7.4.377
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.4.377
Problem:    When 'equalalways' is set a split may report "no room" even though
	    there is plenty of room.
Solution:   Compute the available room properly. (Yukihiro Nakadaira)
Files:	    src/window.c


*** ../vim-7.4.376/src/window.c	2014-07-16 23:39:50.251084976 +0200
--- src/window.c	2014-07-23 15:19:10.491918366 +0200
***************
*** 684,690 ****
      int		available;
      int		oldwin_height = 0;
      int		layout;
!     frame_T	*frp, *curfrp;
      int		before;
      int		minheight;
      int		wmh1;
--- 684,690 ----
      int		available;
      int		oldwin_height = 0;
      int		layout;
!     frame_T	*frp, *curfrp, *frp2, *prevfrp;
      int		before;
      int		minheight;
      int		wmh1;
***************
*** 730,741 ****
  	needed = wmw1 + 1;
  	if (flags & WSP_ROOM)
  	    needed += p_wiw - wmw1;
! 	if (p_ea || (flags & (WSP_BOT | WSP_TOP)))
  	{
  	    minwidth = frame_minwidth(topframe, NOWIN);
  	    available = topframe->fr_width;
  	    needed += minwidth;
  	}
  	else
  	{
  	    minwidth = frame_minwidth(oldwin->w_frame, NOWIN);
--- 730,758 ----
  	needed = wmw1 + 1;
  	if (flags & WSP_ROOM)
  	    needed += p_wiw - wmw1;
! 	if (flags & (WSP_BOT | WSP_TOP))
  	{
  	    minwidth = frame_minwidth(topframe, NOWIN);
  	    available = topframe->fr_width;
  	    needed += minwidth;
  	}
+ 	else if (p_ea)
+ 	{
+ 	    minwidth = frame_minwidth(oldwin->w_frame, NOWIN);
+ 	    prevfrp = oldwin->w_frame;
+ 	    for (frp = oldwin->w_frame->fr_parent; frp != NULL;
+ 							frp = frp->fr_parent)
+ 	    {
+ 		if (frp->fr_layout == FR_ROW)
+ 		    for (frp2 = frp->fr_child; frp2 != NULL;
+ 							frp2 = frp2->fr_next)
+ 			if (frp2 != prevfrp)
+ 			    minwidth += frame_minwidth(frp2, NOWIN);
+ 		prevfrp = frp;
+ 	    }
+ 	    available = topframe->fr_width;
+ 	    needed += minwidth;
+ 	}
  	else
  	{
  	    minwidth = frame_minwidth(oldwin->w_frame, NOWIN);
***************
*** 798,809 ****
  	needed = wmh1 + STATUS_HEIGHT;
  	if (flags & WSP_ROOM)
  	    needed += p_wh - wmh1;
! 	if (p_ea || (flags & (WSP_BOT | WSP_TOP)))
  	{
  	    minheight = frame_minheight(topframe, NOWIN) + need_status;
  	    available = topframe->fr_height;
  	    needed += minheight;
  	}
  	else
  	{
  	    minheight = frame_minheight(oldwin->w_frame, NOWIN) + need_status;
--- 815,843 ----
  	needed = wmh1 + STATUS_HEIGHT;
  	if (flags & WSP_ROOM)
  	    needed += p_wh - wmh1;
! 	if (flags & (WSP_BOT | WSP_TOP))
  	{
  	    minheight = frame_minheight(topframe, NOWIN) + need_status;
  	    available = topframe->fr_height;
  	    needed += minheight;
  	}
+ 	else if (p_ea)
+ 	{
+ 	    minheight = frame_minheight(oldwin->w_frame, NOWIN) + need_status;
+ 	    prevfrp = oldwin->w_frame;
+ 	    for (frp = oldwin->w_frame->fr_parent; frp != NULL;
+ 							frp = frp->fr_parent)
+ 	    {
+ 		if (frp->fr_layout == FR_COL)
+ 		    for (frp2 = frp->fr_child; frp2 != NULL;
+ 							frp2 = frp2->fr_next)
+ 			if (frp2 != prevfrp)
+ 			    minheight += frame_minheight(frp2, NOWIN);
+ 		prevfrp = frp;
+ 	    }
+ 	    available = topframe->fr_height;
+ 	    needed += minheight;
+ 	}
  	else
  	{
  	    minheight = frame_minheight(oldwin->w_frame, NOWIN) + need_status;
*** ../vim-7.4.376/src/version.c	2014-07-23 13:50:41.839956521 +0200
--- src/version.c	2014-07-23 15:20:33.227917771 +0200
***************
*** 736,737 ****
--- 736,739 ----
  {   /* Add new patch number below this line */
+ /**/
+     377,
  /**/

-- 
LARGE MAN:   Who's that then?
CART DRIVER: (Grudgingly) I dunno, Must be a king.
LARGE MAN:   Why?
CART DRIVER: He hasn't got shit all over him.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///