Skip to content

Commit 96ad8c9

Browse files
committed
patch 8.0.0789: splitting terminal window has resizing problems
Problem: When splitting a terminal window where the terminal follows the size of the window doesn't work. Solution: Use the size of the smallest window. (Yasuhiro Matsumoto, closes #1885)
1 parent f86eea9 commit 96ad8c9

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

src/terminal.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -927,8 +927,22 @@ term_update_window(win_T *wp)
927927
if ((!term->tl_rows_fixed && term->tl_rows != wp->w_height)
928928
|| (!term->tl_cols_fixed && term->tl_cols != wp->w_width))
929929
{
930-
int rows = term->tl_rows_fixed ? term->tl_rows : wp->w_height;
931-
int cols = term->tl_cols_fixed ? term->tl_cols : wp->w_width;
930+
int rows = term->tl_rows_fixed ? term->tl_rows : wp->w_height;
931+
int cols = term->tl_cols_fixed ? term->tl_cols : wp->w_width;
932+
win_T *twp;
933+
934+
FOR_ALL_WINDOWS(twp)
935+
{
936+
/* When more than one window shows the same terminal, use the
937+
* smallest size. */
938+
if (twp->w_buffer == term->tl_buffer)
939+
{
940+
if (!term->tl_rows_fixed && rows > twp->w_height)
941+
rows = twp->w_height;
942+
if (!term->tl_cols_fixed && cols > twp->w_width)
943+
cols = twp->w_width;
944+
}
945+
}
932946

933947
vterm_set_size(vterm, rows, cols);
934948
ch_logn(term->tl_job->jv_channel, "Resizing terminal to %d lines",

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,8 @@ static char *(features[]) =
769769

770770
static int included_patches[] =
771771
{ /* Add new patch number below this line */
772+
/**/
773+
789,
772774
/**/
773775
788,
774776
/**/

0 commit comments

Comments
 (0)