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.
This commit is contained in:
zeertzjq
2025-10-24 06:01:13 +08:00
committed by GitHub
parent 459cffc55f
commit 67832710a5
4 changed files with 90 additions and 5 deletions

View File

@@ -580,7 +580,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,
})