diff options
author | Bram Moolenaar <Bram@vim.org> | 2014-07-23 15:21:20 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2014-07-23 15:21:20 +0200 |
commit | 54368f274245cef549f0c479492ac8664fede0dd (patch) | |
tree | 6cd710b813e7b52838e200a80d0779a994abc3b9 | |
parent | 674fffe855dd7145e1216246d76b13464b7057f7 (diff) | |
download | vim-54368f274245cef549f0c479492ac8664fede0dd.zip |
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)
-rw-r--r-- | src/version.c | 2 | ||||
-rw-r--r-- | src/window.c | 40 |
2 files changed, 39 insertions, 3 deletions
diff --git a/src/version.c b/src/version.c index 47248ee4b..c0b0c3581 100644 --- 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 index f81f5527b..1cf861b47 100644 --- 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; |