summaryrefslogtreecommitdiff
path: root/src/terminal.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-07-08 20:49:07 +0200
committerBram Moolenaar <Bram@vim.org>2018-07-08 20:49:07 +0200
commit875cf8789426cc258d85358ea2c86744a5a87b16 (patch)
tree4688ac646299f89e0fd90f0542afd78d377e8912 /src/terminal.c
parent2338c32b53d20dc18540b1a20845bcd8a6371bff (diff)
downloadvim-git-875cf8789426cc258d85358ea2c86744a5a87b16.tar.gz
patch 8.1.0171: typing CTRL-W n in a terminal window causes ml_get errorv8.1.0171
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.
Diffstat (limited to 'src/terminal.c')
-rw-r--r--src/terminal.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/terminal.c b/src/terminal.c
index 2e99a8598..22b90c833 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -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. */