mirror of
https://github.com/vim/vim.git
synced 2025-10-02 05:04:20 -04:00
updated for version 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)
This commit is contained in:
@@ -734,6 +734,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
377,
|
||||
/**/
|
||||
376,
|
||||
/**/
|
||||
|
40
src/window.c
40
src/window.c
@@ -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;
|
||||
@@ -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);
|
||||
@@ -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;
|
||||
|
Reference in New Issue
Block a user