Mercurial > vim
comparison src/terminal.c @ 11818:0f9780ee4207 v8.0.0789
patch 8.0.0789: splitting terminal window has resizing problems
commit https://github.com/vim/vim/commit/96ad8c9ac181b51605ac1f399c7835a515e5a1fa
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Jul 28 14:17:34 2017 +0200
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)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 28 Jul 2017 14:30:04 +0200 |
parents | f6575adc6ee8 |
children | 1e237c5994fc |
comparison
equal
deleted
inserted
replaced
11817:e802ab098e62 | 11818:0f9780ee4207 |
---|---|
925 * Adjust the size of the vterm unless 'termsize' specifies a fixed size. | 925 * Adjust the size of the vterm unless 'termsize' specifies a fixed size. |
926 */ | 926 */ |
927 if ((!term->tl_rows_fixed && term->tl_rows != wp->w_height) | 927 if ((!term->tl_rows_fixed && term->tl_rows != wp->w_height) |
928 || (!term->tl_cols_fixed && term->tl_cols != wp->w_width)) | 928 || (!term->tl_cols_fixed && term->tl_cols != wp->w_width)) |
929 { | 929 { |
930 int rows = term->tl_rows_fixed ? term->tl_rows : wp->w_height; | 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; | 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 } | |
932 | 946 |
933 vterm_set_size(vterm, rows, cols); | 947 vterm_set_size(vterm, rows, cols); |
934 ch_logn(term->tl_job->jv_channel, "Resizing terminal to %d lines", | 948 ch_logn(term->tl_job->jv_channel, "Resizing terminal to %d lines", |
935 rows); | 949 rows); |
936 term_report_winsize(term, rows, cols); | 950 term_report_winsize(term, rows, cols); |