# HG changeset patch # User Bram Moolenaar # Date 1406121680 -7200 # Node ID 255561411d7ae4b3c713bfb2e2f13c5f08ce0c61 # Parent 827611a8802fa1ac95a6dd2b887d39a477650810 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) diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -735,6 +735,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 377, +/**/ 376, /**/ 375, diff --git a/src/window.c b/src/window.c --- a/src/window.c +++ b/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;