Skip to content

Commit 77ac9b5

Browse files
committed
patch 8.0.0968: crash when switching terminal modes
Problem: Crash when switching terminal modes. (Nikolai Pavlov) Solution: Check that there are scrollback lines.
1 parent 93c92ef commit 77ac9b5

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/terminal.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,14 +1037,13 @@ term_enter_job_mode()
10371037

10381038
/* Remove the terminal contents from the scrollback and the buffer. */
10391039
gap = &term->tl_scrollback;
1040-
while (curbuf->b_ml.ml_line_count > term->tl_scrollback_scrolled)
1040+
while (curbuf->b_ml.ml_line_count > term->tl_scrollback_scrolled
1041+
&& gap->ga_len > 0)
10411042
{
10421043
ml_delete(curbuf->b_ml.ml_line_count, FALSE);
10431044
line = (sb_line_T *)gap->ga_data + gap->ga_len - 1;
10441045
vim_free(line->sb_cells);
10451046
--gap->ga_len;
1046-
if (gap->ga_len == 0)
1047-
break;
10481047
}
10491048
check_cursor();
10501049

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,8 @@ static char *(features[]) =
769769

770770
static int included_patches[] =
771771
{ /* Add new patch number below this line */
772+
/**/
773+
968,
772774
/**/
773775
967,
774776
/**/

0 commit comments

Comments
 (0)