mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
updated for version 7.4.372
Problem: When 'winminheight' is zero there might not be one line for the current window. Solution: Change the size computations. (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 */
|
||||
/**/
|
||||
372,
|
||||
/**/
|
||||
371,
|
||||
/**/
|
||||
|
42
src/window.c
42
src/window.c
@@ -688,6 +688,8 @@ win_split_ins(size, flags, new_wp, dir)
|
||||
int before;
|
||||
int minwidth;
|
||||
int minheight;
|
||||
int wmw1;
|
||||
int wmh1;
|
||||
|
||||
if (flags & WSP_TOP)
|
||||
oldwin = firstwin;
|
||||
@@ -722,19 +724,22 @@ win_split_ins(size, flags, new_wp, dir)
|
||||
* Check if we are able to split the current window and compute its
|
||||
* width.
|
||||
*/
|
||||
needed = p_wmw + 1;
|
||||
/* Current window requires at least 1 space. */
|
||||
wmw1 = (p_wmw == 0 ? 1 : p_wmw);
|
||||
needed = wmw1 + 1;
|
||||
if (flags & WSP_ROOM)
|
||||
needed += p_wiw - p_wmw;
|
||||
needed += p_wiw - wmw1;
|
||||
if (p_ea || (flags & (WSP_BOT | WSP_TOP)))
|
||||
{
|
||||
minwidth = frame_minwidth(topframe, NULL);
|
||||
minwidth = frame_minwidth(topframe, NOWIN);
|
||||
available = topframe->fr_width;
|
||||
needed += minwidth;
|
||||
}
|
||||
else
|
||||
{
|
||||
minwidth = frame_minwidth(oldwin->w_frame, NULL);
|
||||
available = oldwin->w_width;
|
||||
minwidth = frame_minwidth(oldwin->w_frame, NOWIN);
|
||||
available = oldwin->w_frame->fr_width;
|
||||
needed += minwidth;
|
||||
}
|
||||
if (available < needed && new_wp == NULL)
|
||||
{
|
||||
@@ -743,12 +748,10 @@ win_split_ins(size, flags, new_wp, dir)
|
||||
}
|
||||
if (new_size == 0)
|
||||
new_size = oldwin->w_width / 2;
|
||||
if (new_size > oldwin->w_width - p_wmw - 1)
|
||||
new_size = oldwin->w_width - p_wmw - 1;
|
||||
if (new_size > available - minwidth - 1)
|
||||
new_size = available - minwidth - 1;
|
||||
if (new_size < p_wmw)
|
||||
new_size = p_wmw;
|
||||
if (new_size < wmw1)
|
||||
new_size = wmw1;
|
||||
|
||||
/* if it doesn't fit in the current window, need win_equal() */
|
||||
if (oldwin->w_width - new_size - 1 < p_wmw)
|
||||
@@ -789,20 +792,22 @@ win_split_ins(size, flags, new_wp, dir)
|
||||
* Check if we are able to split the current window and compute its
|
||||
* height.
|
||||
*/
|
||||
needed = p_wmh + STATUS_HEIGHT + need_status;
|
||||
/* Current window requires at least 1 space. */
|
||||
wmh1 = (p_wmh == 0 ? 1 : p_wmh);
|
||||
needed = wmh1 + STATUS_HEIGHT;
|
||||
if (flags & WSP_ROOM)
|
||||
needed += p_wh - p_wmh;
|
||||
needed += p_wh - wmh1;
|
||||
if (p_ea || (flags & (WSP_BOT | WSP_TOP)))
|
||||
{
|
||||
minheight = frame_minheight(topframe, NULL);
|
||||
minheight = frame_minheight(topframe, NOWIN) + need_status;
|
||||
available = topframe->fr_height;
|
||||
needed += minheight;
|
||||
}
|
||||
else
|
||||
{
|
||||
minheight = frame_minheight(oldwin->w_frame, NULL);
|
||||
available = oldwin->w_height;
|
||||
needed += p_wmh;
|
||||
minheight = frame_minheight(oldwin->w_frame, NOWIN) + need_status;
|
||||
available = oldwin->w_frame->fr_height;
|
||||
needed += minheight;
|
||||
}
|
||||
if (available < needed && new_wp == NULL)
|
||||
{
|
||||
@@ -817,13 +822,10 @@ win_split_ins(size, flags, new_wp, dir)
|
||||
}
|
||||
if (new_size == 0)
|
||||
new_size = oldwin_height / 2;
|
||||
|
||||
if (new_size > oldwin_height - p_wmh - STATUS_HEIGHT)
|
||||
new_size = oldwin_height - p_wmh - STATUS_HEIGHT;
|
||||
if (new_size > available - minheight - STATUS_HEIGHT)
|
||||
new_size = available - minheight - STATUS_HEIGHT;
|
||||
if (new_size < p_wmh)
|
||||
new_size = p_wmh;
|
||||
if (new_size < wmh1)
|
||||
new_size = wmh1;
|
||||
|
||||
/* if it doesn't fit in the current window, need win_equal() */
|
||||
if (oldwin_height - new_size - STATUS_HEIGHT < p_wmh)
|
||||
|
Reference in New Issue
Block a user