diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-07-28 14:17:34 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-07-28 14:17:34 +0200 |
commit | 96ad8c9ac181b51605ac1f399c7835a515e5a1fa (patch) | |
tree | 44a8c836b621d0d9ecadada2fec06149a8c57d61 | |
parent | f86eea9f01460e3b375ee768d4b863beb690006f (diff) | |
download | vim-git-8.0.0789.tar.gz |
patch 8.0.0789: splitting terminal window has resizing problemsv8.0.0789
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)
-rw-r--r-- | src/terminal.c | 18 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 18 insertions, 2 deletions
diff --git a/src/terminal.c b/src/terminal.c index f197718b0..d12df362f 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -927,8 +927,22 @@ term_update_window(win_T *wp) if ((!term->tl_rows_fixed && term->tl_rows != wp->w_height) || (!term->tl_cols_fixed && term->tl_cols != wp->w_width)) { - int rows = term->tl_rows_fixed ? term->tl_rows : wp->w_height; - int cols = term->tl_cols_fixed ? term->tl_cols : wp->w_width; + int rows = term->tl_rows_fixed ? term->tl_rows : wp->w_height; + int cols = term->tl_cols_fixed ? term->tl_cols : wp->w_width; + win_T *twp; + + FOR_ALL_WINDOWS(twp) + { + /* When more than one window shows the same terminal, use the + * smallest size. */ + if (twp->w_buffer == term->tl_buffer) + { + if (!term->tl_rows_fixed && rows > twp->w_height) + rows = twp->w_height; + if (!term->tl_cols_fixed && cols > twp->w_width) + cols = twp->w_width; + } + } vterm_set_size(vterm, rows, cols); ch_logn(term->tl_job->jv_channel, "Resizing terminal to %d lines", diff --git a/src/version.c b/src/version.c index 7d0666989..83e873502 100644 --- a/src/version.c +++ b/src/version.c @@ -770,6 +770,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 789, +/**/ 788, /**/ 787, |