Skip to content

Commit

Permalink
updated for version 7.4.377
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
brammool committed Jul 23, 2014
1 parent c646c70 commit d824d41
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -734,6 +734,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
377,
/**/
376,
/**/
Expand Down
40 changes: 37 additions & 3 deletions src/window.c
Expand Up @@ -684,7 +684,7 @@ win_split_ins(size, flags, new_wp, dir)
int available;
int oldwin_height = 0;
int layout;
frame_T *frp, *curfrp;
frame_T *frp, *curfrp, *frp2, *prevfrp;
int before;
int minheight;
int wmh1;
Expand Down Expand Up @@ -730,12 +730,29 @@ win_split_ins(size, flags, new_wp, dir)
needed = wmw1 + 1;
if (flags & WSP_ROOM)
needed += p_wiw - wmw1;
if (p_ea || (flags & (WSP_BOT | WSP_TOP)))
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);
Expand Down Expand Up @@ -798,12 +815,29 @@ win_split_ins(size, flags, new_wp, dir)
needed = wmh1 + STATUS_HEIGHT;
if (flags & WSP_ROOM)
needed += p_wh - wmh1;
if (p_ea || (flags & (WSP_BOT | WSP_TOP)))
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;
Expand Down

0 comments on commit d824d41

Please sign in to comment.