forked from aniani/vim
patch 8.0.1334: splitting a window with a WinBar damages window layout
Problem: Splitting a window with a WinBar damages window layout. (Lifepillar) Solution: Take the winbar into account when computing the new window position. Add WINBAR_HEIGHT().
This commit is contained in:
@@ -771,6 +771,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1334,
|
||||||
/**/
|
/**/
|
||||||
1333,
|
1333,
|
||||||
/**/
|
/**/
|
||||||
|
@@ -1485,6 +1485,11 @@ typedef UINT32_TYPEDEF UINT32_T;
|
|||||||
#define MIN_COLUMNS 12 /* minimal columns for screen */
|
#define MIN_COLUMNS 12 /* minimal columns for screen */
|
||||||
#define MIN_LINES 2 /* minimal lines for screen */
|
#define MIN_LINES 2 /* minimal lines for screen */
|
||||||
#define STATUS_HEIGHT 1 /* height of a status line under a window */
|
#define STATUS_HEIGHT 1 /* height of a status line under a window */
|
||||||
|
#ifdef FEAT_MENU /* height of a status line under a window */
|
||||||
|
# define WINBAR_HEIGHT(wp) (wp)->w_winbar_height
|
||||||
|
#else
|
||||||
|
# define WINBAR_HEIGHT(wp) 0
|
||||||
|
#endif
|
||||||
#define QF_WINHEIGHT 10 /* default height for quickfix window */
|
#define QF_WINHEIGHT 10 /* default height for quickfix window */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
29
src/window.c
29
src/window.c
@@ -1098,21 +1098,14 @@ win_split_ins(
|
|||||||
/* set height and row of new window to full height */
|
/* set height and row of new window to full height */
|
||||||
wp->w_winrow = tabline_height();
|
wp->w_winrow = tabline_height();
|
||||||
win_new_height(wp, curfrp->fr_height - (p_ls > 0)
|
win_new_height(wp, curfrp->fr_height - (p_ls > 0)
|
||||||
#ifdef FEAT_MENU
|
- WINBAR_HEIGHT(wp));
|
||||||
- wp->w_winbar_height
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
wp->w_status_height = (p_ls > 0);
|
wp->w_status_height = (p_ls > 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* height and row of new window is same as current window */
|
/* height and row of new window is same as current window */
|
||||||
wp->w_winrow = oldwin->w_winrow;
|
wp->w_winrow = oldwin->w_winrow;
|
||||||
win_new_height(wp, oldwin->w_height
|
win_new_height(wp, oldwin->w_height + WINBAR_HEIGHT(oldwin));
|
||||||
#ifdef FEAT_MENU
|
|
||||||
+ oldwin->w_winbar_height
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
wp->w_status_height = oldwin->w_status_height;
|
wp->w_status_height = oldwin->w_status_height;
|
||||||
}
|
}
|
||||||
frp->fr_height = curfrp->fr_height;
|
frp->fr_height = curfrp->fr_height;
|
||||||
@@ -1171,10 +1164,7 @@ win_split_ins(
|
|||||||
if (flags & (WSP_TOP | WSP_BOT))
|
if (flags & (WSP_TOP | WSP_BOT))
|
||||||
{
|
{
|
||||||
int new_fr_height = curfrp->fr_height - new_size
|
int new_fr_height = curfrp->fr_height - new_size
|
||||||
#ifdef FEAT_MENU
|
+ WINBAR_HEIGHT(wp) ;
|
||||||
+ wp->w_winbar_height
|
|
||||||
#endif
|
|
||||||
;
|
|
||||||
|
|
||||||
if (!((flags & WSP_BOT) && p_ls == 0))
|
if (!((flags & WSP_BOT) && p_ls == 0))
|
||||||
new_fr_height -= STATUS_HEIGHT;
|
new_fr_height -= STATUS_HEIGHT;
|
||||||
@@ -1190,7 +1180,8 @@ win_split_ins(
|
|||||||
}
|
}
|
||||||
else /* new window below current one */
|
else /* new window below current one */
|
||||||
{
|
{
|
||||||
wp->w_winrow = oldwin->w_winrow + oldwin->w_height + STATUS_HEIGHT;
|
wp->w_winrow = oldwin->w_winrow + oldwin->w_height
|
||||||
|
+ STATUS_HEIGHT + WINBAR_HEIGHT(oldwin);
|
||||||
wp->w_status_height = oldwin->w_status_height;
|
wp->w_status_height = oldwin->w_status_height;
|
||||||
if (!(flags & WSP_BOT))
|
if (!(flags & WSP_BOT))
|
||||||
oldwin->w_status_height = STATUS_HEIGHT;
|
oldwin->w_status_height = STATUS_HEIGHT;
|
||||||
@@ -2867,10 +2858,7 @@ frame_new_height(
|
|||||||
/* Simple case: just one window. */
|
/* Simple case: just one window. */
|
||||||
win_new_height(topfrp->fr_win,
|
win_new_height(topfrp->fr_win,
|
||||||
height - topfrp->fr_win->w_status_height
|
height - topfrp->fr_win->w_status_height
|
||||||
#ifdef FEAT_MENU
|
- WINBAR_HEIGHT(topfrp->fr_win));
|
||||||
- topfrp->fr_win->w_winbar_height
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
else if (topfrp->fr_layout == FR_ROW)
|
else if (topfrp->fr_layout == FR_ROW)
|
||||||
{
|
{
|
||||||
@@ -3217,10 +3205,7 @@ frame_fix_width(win_T *wp)
|
|||||||
frame_fix_height(win_T *wp)
|
frame_fix_height(win_T *wp)
|
||||||
{
|
{
|
||||||
wp->w_frame->fr_height = wp->w_height + wp->w_status_height
|
wp->w_frame->fr_height = wp->w_height + wp->w_status_height
|
||||||
#ifdef FEAT_MENU
|
+ WINBAR_HEIGHT(wp) ;
|
||||||
+ wp->w_winbar_height
|
|
||||||
#endif
|
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user