comparison src/terminal.c @ 14311:83b870d9ac4b v8.1.0171

patch 8.1.0171: typing CTRL-W n in a terminal window causes ml_get error commit https://github.com/vim/vim/commit/875cf8789426cc258d85358ea2c86744a5a87b16 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jul 8 20:49:07 2018 +0200 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.
author Christian Brabandt <cb@256bit.org>
date Sun, 08 Jul 2018 21:00:07 +0200
parents 3c80092eb211
children 5faab0545f3c
comparison
equal deleted inserted replaced
14310:d8b3135ad9a4 14311:83b870d9ac4b
3132 newrows = rows == 0 ? newrows : minsize ? MAX(rows, newrows) : rows; 3132 newrows = rows == 0 ? newrows : minsize ? MAX(rows, newrows) : rows;
3133 newcols = cols == 0 ? newcols : minsize ? MAX(cols, newcols) : cols; 3133 newcols = cols == 0 ? newcols : minsize ? MAX(cols, newcols) : cols;
3134 3134
3135 if (term->tl_rows != newrows || term->tl_cols != newcols) 3135 if (term->tl_rows != newrows || term->tl_cols != newcols)
3136 { 3136 {
3137
3138
3139 term->tl_vterm_size_changed = TRUE; 3137 term->tl_vterm_size_changed = TRUE;
3140 vterm_set_size(vterm, newrows, newcols); 3138 vterm_set_size(vterm, newrows, newcols);
3141 ch_log(term->tl_job->jv_channel, "Resizing terminal to %d lines", 3139 ch_log(term->tl_job->jv_channel, "Resizing terminal to %d lines",
3142 newrows); 3140 newrows);
3143 term_report_winsize(term, newrows, newcols); 3141 term_report_winsize(term, newrows, newcols);
3142
3143 // Updating the terminal size will cause the snapshot to be cleared.
3144 // When not in terminal_loop() we need to restore it.
3145 if (term != in_terminal_loop)
3146 may_move_terminal_to_buffer(term, FALSE);
3144 } 3147 }
3145 3148
3146 /* The cursor may have been moved when resizing. */ 3149 /* The cursor may have been moved when resizing. */
3147 vterm_state_get_cursorpos(state, &pos); 3150 vterm_state_get_cursorpos(state, &pos);
3148 position_cursor(wp, &pos); 3151 position_cursor(wp, &pos);