aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarco Hinz <mh.codebro@gmail.com>2016-06-20 18:20:19 +0200
committerMarco Hinz <mh.codebro@gmail.com>2016-06-20 18:20:45 +0200
commitcc8f477d18ef872b1f8850213a23c4fe333f2fcf (patch)
treee819395817cf506c915980ccfc8653d7c0a034e9 /src
parent7df9dd33a1497493bc1d78a533473684388c05b0 (diff)
downloadrneovim-cc8f477d18ef872b1f8850213a23c4fe333f2fcf.tar.gz
rneovim-cc8f477d18ef872b1f8850213a23c4fe333f2fcf.tar.bz2
rneovim-cc8f477d18ef872b1f8850213a23c4fe333f2fcf.zip
Always resize the embedded vterm properly
Diffstat (limited to 'src')
-rw-r--r--src/nvim/buffer.c4
-rw-r--r--src/nvim/terminal.c9
-rw-r--r--src/nvim/window.c4
3 files changed, 8 insertions, 9 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index 72724b0ffd..438a85dd5d 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -1249,6 +1249,10 @@ void enter_buffer(buf_T *buf)
/* mark cursor position as being invalid */
curwin->w_valid = 0;
+ if (buf->terminal) {
+ terminal_resize(buf->terminal, curwin->w_width, curwin->w_height);
+ }
+
/* Make sure the buffer is loaded. */
if (curbuf->b_ml.ml_mfp == NULL) { /* need to load the file */
/* If there is no filetype, allow for detecting one. Esp. useful for
diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c
index 3e41926b70..fd416b3dcc 100644
--- a/src/nvim/terminal.c
+++ b/src/nvim/terminal.c
@@ -348,15 +348,6 @@ void terminal_resize(Terminal *term, uint16_t width, uint16_t height)
height = (uint16_t)curheight;
}
- // The new width/height are the minimum for all windows that display the
- // terminal in the current tab.
- FOR_ALL_WINDOWS_IN_TAB(wp, curtab) {
- if (!wp->w_closing && wp->w_buffer->terminal == term) {
- width = (uint16_t)MIN(width, (uint16_t)(wp->w_width - win_col_off(wp)));
- height = (uint16_t)MIN(height, (uint16_t)wp->w_height);
- }
- }
-
if (curheight == height && curwidth == width) {
return;
}
diff --git a/src/nvim/window.c b/src/nvim/window.c
index bea55c465f..4eaba3a3df 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -3613,6 +3613,10 @@ static void win_enter_ext(win_T *wp, bool undo_sync, int curwin_invalid, int tri
/* Change directories when the 'acd' option is set. */
do_autochdir();
+
+ if (curbuf->terminal) {
+ terminal_resize(curbuf->terminal, curwin->w_width, curwin->w_height);
+ }
}