0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 8.0.0968: crash when switching terminal modes

Problem:    Crash when switching terminal modes. (Nikolai Pavlov)
Solution:   Check that there are scrollback lines.
This commit is contained in:
Bram Moolenaar 2017-08-19 21:23:05 +02:00
parent 93c92eff26
commit 77ac9b5c62
2 changed files with 4 additions and 3 deletions

View File

@ -1037,14 +1037,13 @@ term_enter_job_mode()
/* Remove the terminal contents from the scrollback and the buffer. */
gap = &term->tl_scrollback;
while (curbuf->b_ml.ml_line_count > term->tl_scrollback_scrolled)
while (curbuf->b_ml.ml_line_count > term->tl_scrollback_scrolled
&& gap->ga_len > 0)
{
ml_delete(curbuf->b_ml.ml_line_count, FALSE);
line = (sb_line_T *)gap->ga_data + gap->ga_len - 1;
vim_free(line->sb_cells);
--gap->ga_len;
if (gap->ga_len == 0)
break;
}
check_cursor();

View File

@ -769,6 +769,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
968,
/**/
967,
/**/