mirror of
https://github.com/neovim/neovim.git
synced 2025-09-23 11:38:31 +00:00
Always resize the embedded vterm properly
This commit is contained in:
@@ -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
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user