]> granicus.if.org Git - vim/commitdiff
patch 8.0.0789: splitting terminal window has resizing problems v8.0.0789
authorBram Moolenaar <Bram@vim.org>
Fri, 28 Jul 2017 12:17:34 +0000 (14:17 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 28 Jul 2017 12:17:34 +0000 (14:17 +0200)
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)

src/terminal.c
src/version.c

index f197718b05d261aaa479dca135baca98531d129c..d12df362fd437088da56c1b6a9f37a539dc2d7e3 100644 (file)
@@ -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",
index 7d066698971a0db54310705084e8c403cc7f4782..83e873502afbbdc93969e01a3cf5301c454cd227 100644 (file)
@@ -769,6 +769,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    789,
 /**/
     788,
 /**/