neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 459cffc55f7651a33b638028680255a775dded3d
parent af0f7b59b1fcd92e64841cb5da8a577e944ce5bb
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Thu, 23 Oct 2025 17:40:45 +0800

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.
Diffstat:
Msrc/nvim/memline.c | 2+-
Msrc/nvim/terminal.c | 4++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/nvim/memline.c b/src/nvim/memline.c @@ -2581,7 +2581,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. diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c @@ -2211,11 +2211,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.