diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-05-12 16:55:14 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-05-12 16:55:14 +0200 |
commit | 3f1a53c4349a309c3f4acf358d3cf18f9c455050 (patch) | |
tree | 4af721860a28faa627b037cd21c6a70868805d84 | |
parent | b0f42ba60d9e6d101d103421ba0c351811615c15 (diff) |
patch 8.0.1818: lines remove from wrong buffer when using terminal windowv8.0.1818
Problem: Lines remove from wrong buffer when using terminal window.
Solution: Make sure to use tl_buffer.
-rw-r--r-- | src/terminal.c | 9 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/terminal.c b/src/terminal.c index 1991f382f3..277f18bcd6 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -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) @@ -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(); } /* @@ -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, diff --git a/src/version.c b/src/version.c index 81f867b981..5d85a807be 100644 --- a/src/version.c +++ b/src/version.c @@ -762,6 +762,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1818, +/**/ 1817, /**/ 1816, |