fix(terminal): wrong row in TermRequest with full scrollback (#36298)

Problem:  Wrong row in TermRequest with full scrollback.
Solution: Subtract by the number of lines deleted from scrollback.
(cherry picked from commit 67832710a5)
This commit is contained in:
zeertzjq
2025-10-24 06:01:13 +08:00
committed by github-actions[bot]
parent e67fec1541
commit 169dc60a44
4 changed files with 90 additions and 5 deletions

View File

@@ -566,7 +566,9 @@ do
callback = function(args)
if string.match(args.data.sequence, '^\027]133;A') then
local lnum = args.data.cursor[1] ---@type integer
vim.api.nvim_buf_set_extmark(args.buf, nvim_terminal_prompt_ns, lnum - 1, 0, {})
if lnum >= 1 then
vim.api.nvim_buf_set_extmark(args.buf, nvim_terminal_prompt_ns, lnum - 1, 0, {})
end
end
end,
})