0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.1.0171: typing CTRL-W n in a terminal window causes ml_get error

Problem:    Typing CTRL-W n in a terminal window causes ml_get error.
Solution:   When resizing the terminal outside of terminal_loop() make sure
            the snapshot is complete.
This commit is contained in:
Bram Moolenaar
2018-07-08 20:49:07 +02:00
parent 2338c32b53
commit 875cf87894
3 changed files with 33 additions and 2 deletions

View File

@@ -3134,13 +3134,16 @@ term_update_window(win_T *wp)
if (term->tl_rows != newrows || term->tl_cols != newcols)
{
term->tl_vterm_size_changed = TRUE;
vterm_set_size(vterm, newrows, newcols);
ch_log(term->tl_job->jv_channel, "Resizing terminal to %d lines",
newrows);
term_report_winsize(term, newrows, newcols);
// Updating the terminal size will cause the snapshot to be cleared.
// When not in terminal_loop() we need to restore it.
if (term != in_terminal_loop)
may_move_terminal_to_buffer(term, FALSE);
}
/* The cursor may have been moved when resizing. */