mirror of
https://github.com/neovim/neovim.git
synced 2025-12-13 18:12:50 +00:00
fix(terminal): deleting from wrong buffer (#36289)
Follow-up to #33721.
This doesn't seem to affect actual behavior for now, as these two lines
seem only reachable when the 'scrollback' option is changed, and options
can currently only be changed in the current buffer.
(cherry picked from commit 459cffc55f)
This commit is contained in:
committed by
github-actions[bot]
parent
edf89db077
commit
e67fec1541
@@ -2551,7 +2551,7 @@ int ml_delete_buf(buf_T *buf, linenr_T lnum, bool message)
|
||||
FUNC_ATTR_NONNULL_ALL
|
||||
{
|
||||
ml_flush_line(buf, false);
|
||||
return ml_delete_int(buf, lnum, message);
|
||||
return ml_delete_int(buf, lnum, message ? ML_DEL_MESSAGE : 0);
|
||||
}
|
||||
|
||||
/// Delete line `lnum` in the current buffer.
|
||||
|
||||
@@ -2132,11 +2132,11 @@ static void adjust_scrollback(Terminal *term, buf_T *buf)
|
||||
if (scbk < term->sb_current) {
|
||||
size_t diff = term->sb_current - scbk;
|
||||
for (size_t i = 0; i < diff; i++) {
|
||||
ml_delete(1);
|
||||
ml_delete_buf(buf, 1, false);
|
||||
term->sb_current--;
|
||||
xfree(term->sb_buffer[term->sb_current]);
|
||||
}
|
||||
deleted_lines(1, (linenr_T)diff);
|
||||
deleted_lines_buf(buf, 1, (linenr_T)diff);
|
||||
}
|
||||
|
||||
// Resize the scrollback storage.
|
||||
|
||||
Reference in New Issue
Block a user