Compare commits

...

2 Commits

Author SHA1 Message Date
Bram Moolenaar
71b2964066 patch 8.0.1126: endless resize when terminal showing in two buffers
Problem:    Endless resize when terminal showing in two buffers. (Hirohito
            Higashi)
Solution:   Set a flag to prevent resizing the window.
2017-09-18 21:24:56 +02:00
Bram Moolenaar
d326ad6e93 patch 8.0.1125: wrong window height when splitting window with window toolbar
Problem:    Wrong window height when splitting window with window toolbar.
Solution:   Add or subtract the window toolbar height.
2017-09-18 20:31:41 +02:00
3 changed files with 44 additions and 11 deletions

View File

@@ -99,6 +99,9 @@ struct terminal_S {
job_T *tl_job;
buf_T *tl_buffer;
/* Set when setting the size of a vterm, reset after redrawing. */
int tl_vterm_size_changed;
/* used when tl_job is NULL and only a pty was created */
int tl_tty_fd;
char_u *tl_tty_in;
@@ -2017,16 +2020,21 @@ handle_resize(int rows, int cols, void *user)
term->tl_rows = rows;
term->tl_cols = cols;
FOR_ALL_WINDOWS(wp)
if (term->tl_vterm_size_changed)
/* Size was set by vterm_set_size(), don't set the window size. */
term->tl_vterm_size_changed = FALSE;
else
{
if (wp->w_buffer == term->tl_buffer)
FOR_ALL_WINDOWS(wp)
{
win_setheight_win(rows, wp);
win_setwidth_win(cols, wp);
if (wp->w_buffer == term->tl_buffer)
{
win_setheight_win(rows, wp);
win_setwidth_win(cols, wp);
}
}
redraw_buf_later(term->tl_buffer, NOT_VALID);
}
redraw_buf_later(term->tl_buffer, NOT_VALID);
return 1;
}
@@ -2223,6 +2231,7 @@ term_update_window(win_T *wp)
}
}
term->tl_vterm_size_changed = TRUE;
vterm_set_size(vterm, rows, cols);
ch_log(term->tl_job->jv_channel, "Resizing terminal to %d lines",
rows);

View File

@@ -761,6 +761,10 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1126,
/**/
1125,
/**/
1124,
/**/

View File

@@ -1098,14 +1098,22 @@ win_split_ins(
{
/* set height and row of new window to full 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
- wp->w_winbar_height
#endif
);
wp->w_status_height = (p_ls > 0);
}
else
{
/* height and row of new window is same as current window */
wp->w_winrow = oldwin->w_winrow;
win_new_height(wp, oldwin->w_height);
win_new_height(wp, oldwin->w_height
#ifdef FEAT_MENU
+ oldwin->w_winbar_height
#endif
);
wp->w_status_height = oldwin->w_status_height;
}
frp->fr_height = curfrp->fr_height;
@@ -1163,7 +1171,11 @@ win_split_ins(
win_new_height(wp, new_size);
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
+ wp->w_winbar_height
#endif
;
if (!((flags & WSP_BOT) && p_ls == 0))
new_fr_height -= STATUS_HEIGHT;
@@ -2855,7 +2867,11 @@ frame_new_height(
{
/* Simple case: just one window. */
win_new_height(topfrp->fr_win,
height - topfrp->fr_win->w_status_height);
height - topfrp->fr_win->w_status_height
#ifdef FEAT_MENU
- topfrp->fr_win->w_winbar_height
#endif
);
}
else if (topfrp->fr_layout == FR_ROW)
{
@@ -3201,7 +3217,11 @@ frame_fix_width(win_T *wp)
static void
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
+ wp->w_winbar_height
#endif
;
}
/*