mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-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) https://code.google.com/p/vim/source/detail?r=v7-4-377
This commit is contained in:
parent
ab4feeac82
commit
f379b44747
@ -218,7 +218,7 @@ static int included_patches[] = {
|
|||||||
//380 NA
|
//380 NA
|
||||||
//379,
|
//379,
|
||||||
//378,
|
//378,
|
||||||
//377,
|
377,
|
||||||
376,
|
376,
|
||||||
//375,
|
//375,
|
||||||
//374,
|
//374,
|
||||||
|
@ -540,7 +540,7 @@ int win_split_ins(int size, int flags, win_T *new_wp, int dir)
|
|||||||
int available;
|
int available;
|
||||||
int oldwin_height = 0;
|
int oldwin_height = 0;
|
||||||
int layout;
|
int layout;
|
||||||
frame_T *frp, *curfrp;
|
frame_T *frp, *curfrp, *frp2, *prevfrp;
|
||||||
int before;
|
int before;
|
||||||
int minheight;
|
int minheight;
|
||||||
int wmh1;
|
int wmh1;
|
||||||
@ -578,10 +578,26 @@ int win_split_ins(int size, int flags, win_T *new_wp, int dir)
|
|||||||
if (flags & WSP_ROOM) {
|
if (flags & WSP_ROOM) {
|
||||||
needed += p_wiw - wmw1;
|
needed += p_wiw - wmw1;
|
||||||
}
|
}
|
||||||
if (p_ea || (flags & (WSP_BOT | WSP_TOP))) {
|
if (flags & (WSP_BOT | WSP_TOP)) {
|
||||||
minwidth = frame_minwidth(topframe, NOWIN);
|
minwidth = frame_minwidth(topframe, NOWIN);
|
||||||
available = topframe->fr_width;
|
available = topframe->fr_width;
|
||||||
needed += minwidth;
|
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 {
|
} else {
|
||||||
minwidth = frame_minwidth(oldwin->w_frame, NOWIN);
|
minwidth = frame_minwidth(oldwin->w_frame, NOWIN);
|
||||||
available = oldwin->w_frame->fr_width;
|
available = oldwin->w_frame->fr_width;
|
||||||
@ -639,10 +655,26 @@ int win_split_ins(int size, int flags, win_T *new_wp, int dir)
|
|||||||
if (flags & WSP_ROOM) {
|
if (flags & WSP_ROOM) {
|
||||||
needed += p_wh - wmh1;
|
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;
|
minheight = frame_minheight(topframe, NOWIN) + need_status;
|
||||||
available = topframe->fr_height;
|
available = topframe->fr_height;
|
||||||
needed += minheight;
|
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 {
|
} else {
|
||||||
minheight = frame_minheight(oldwin->w_frame, NOWIN) + need_status;
|
minheight = frame_minheight(oldwin->w_frame, NOWIN) + need_status;
|
||||||
available = oldwin->w_frame->fr_height;
|
available = oldwin->w_frame->fr_height;
|
||||||
|
Loading…
Reference in New Issue
Block a user