mirror of
https://github.com/neovim/neovim.git
synced 2025-12-19 04:45:38 +00:00
fix(terminal): adjust marks when deleting scrollback lines (#36294)
This also fixes inconsistent scrolling behavior on terminal output when cursor is in the middle of the buffer and the scrollback is full.
This commit is contained in:
@@ -431,7 +431,7 @@ void nvim_buf_set_lines(uint64_t channel_id, Buffer buffer, Integer start, Integ
|
||||
// changed range, and move any in the remainder of the buffer.
|
||||
linenr_T adjust = end > start ? MAXLNUM : 0;
|
||||
mark_adjust_buf(buf, (linenr_T)start, (linenr_T)(end - 1), adjust, (linenr_T)extra,
|
||||
true, true, kExtmarkNOOP);
|
||||
true, kMarkAdjustApi, kExtmarkNOOP);
|
||||
|
||||
extmark_splice(buf, (int)start - 1, 0, (int)(end - start), 0,
|
||||
deleted_bytes, (int)new_len, 0, inserted_bytes,
|
||||
@@ -664,7 +664,7 @@ void nvim_buf_set_text(uint64_t channel_id, Buffer buffer, Integer start_row, In
|
||||
// Do not adjust any cursors. need to use column-aware logic (below)
|
||||
linenr_T adjust = end_row >= start_row ? MAXLNUM : 0;
|
||||
mark_adjust_buf(buf, (linenr_T)start_row, (linenr_T)end_row, adjust, (linenr_T)extra,
|
||||
true, true, kExtmarkNOOP);
|
||||
true, kMarkAdjustApi, kExtmarkNOOP);
|
||||
|
||||
extmark_splice(buf, (int)start_row - 1, (colnr_T)start_col,
|
||||
(int)(end_row - start_row), col_extent, old_byte,
|
||||
|
||||
Reference in New Issue
Block a user