mirror of
https://github.com/neovim/neovim.git
synced 2026-08-25 08:31:51 +00:00
fix(ui2): offset extmarks copied to pager by srow #41425
Problem: wrong end_row when copying extmarks to the pager buffer when expanding a message. Results in incorrect highlights or errors such as "invalid `end_col` out of range". Solution: don't forget to offset end_row by srow, as is already done for the copied lines and extmark rows.
This commit is contained in:
@@ -239,7 +239,8 @@ function M.expand_msg(src, tgt, focus)
|
||||
|
||||
api.nvim_buf_set_lines(ui.bufs[tgt], srow, -1, false, lines)
|
||||
for _, m in ipairs(marks) do
|
||||
hlopts.hl_group, hlopts.end_col, hlopts.end_row = m[4].hl_group, m[4].end_col, m[4].end_row
|
||||
hlopts.hl_group, hlopts.end_col, hlopts.end_row =
|
||||
m[4].hl_group, m[4].end_col, srow + m[4].end_row
|
||||
api.nvim_buf_set_extmark(ui.bufs[tgt], ui.ns, srow + m[2], m[3], hlopts)
|
||||
end
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user