Skip to content

Commit

Permalink
patch 8.0.1818: lines remove from wrong buffer when using terminal wi…
Browse files Browse the repository at this point in the history
…ndow

Problem:    Lines remove from wrong buffer when using terminal window.
Solution:   Make sure to use tl_buffer.
  • Loading branch information
brammool committed May 12, 2018
1 parent b0f42ba commit 3f1a53c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/terminal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1462,6 +1462,7 @@ cleanup_scrollback(term_T *term)
sb_line_T *line;
garray_T *gap;

curbuf = term->tl_buffer;
gap = &term->tl_scrollback;
while (curbuf->b_ml.ml_line_count > term->tl_scrollback_scrolled
&& gap->ga_len > 0)
Expand All @@ -1471,7 +1472,9 @@ cleanup_scrollback(term_T *term)
vim_free(line->sb_cells);
--gap->ga_len;
}
check_cursor();
curbuf = curwin->w_buffer;
if (curbuf == term->tl_buffer)
check_cursor();
}

/*
Expand All @@ -1495,8 +1498,8 @@ move_terminal_to_buffer(term_T *term)

/* Nothing to do if the buffer already has the lines and nothing was
* changed. */
if (!term->tl_dirty_snapshot
&& curbuf->b_ml.ml_line_count > term->tl_scrollback_scrolled)
if (!term->tl_dirty_snapshot && term->tl_buffer->b_ml.ml_line_count
> term->tl_scrollback_scrolled)
return;

ch_log(term->tl_job == NULL ? NULL : term->tl_job->jv_channel,
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1818,
/**/
1817,
/**/
Expand Down

0 comments on commit 3f1a53c

Please sign in to comment.