forked from aniani/vim
patch 8.0.1818: lines remove from wrong buffer when using terminal window
Problem: Lines remove from wrong buffer when using terminal window. Solution: Make sure to use tl_buffer.
This commit is contained in:
@@ -1462,6 +1462,7 @@ cleanup_scrollback(term_T *term)
|
|||||||
sb_line_T *line;
|
sb_line_T *line;
|
||||||
garray_T *gap;
|
garray_T *gap;
|
||||||
|
|
||||||
|
curbuf = term->tl_buffer;
|
||||||
gap = &term->tl_scrollback;
|
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)
|
&& gap->ga_len > 0)
|
||||||
@@ -1471,6 +1472,8 @@ cleanup_scrollback(term_T *term)
|
|||||||
vim_free(line->sb_cells);
|
vim_free(line->sb_cells);
|
||||||
--gap->ga_len;
|
--gap->ga_len;
|
||||||
}
|
}
|
||||||
|
curbuf = curwin->w_buffer;
|
||||||
|
if (curbuf == term->tl_buffer)
|
||||||
check_cursor();
|
check_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1495,8 +1498,8 @@ move_terminal_to_buffer(term_T *term)
|
|||||||
|
|
||||||
/* Nothing to do if the buffer already has the lines and nothing was
|
/* Nothing to do if the buffer already has the lines and nothing was
|
||||||
* changed. */
|
* changed. */
|
||||||
if (!term->tl_dirty_snapshot
|
if (!term->tl_dirty_snapshot && term->tl_buffer->b_ml.ml_line_count
|
||||||
&& curbuf->b_ml.ml_line_count > term->tl_scrollback_scrolled)
|
> term->tl_scrollback_scrolled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ch_log(term->tl_job == NULL ? NULL : term->tl_job->jv_channel,
|
ch_log(term->tl_job == NULL ? NULL : term->tl_job->jv_channel,
|
||||||
|
@@ -761,6 +761,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1818,
|
||||||
/**/
|
/**/
|
||||||
1817,
|
1817,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user