diff options
| author | Sean Dewar <6256228+seandewar@users.noreply.github.com> | 2026-08-22 15:19:16 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-22 10:19:16 -0400 |
| commit | dadaa7fcade459ebd1fef2ee4eada1a389ea036d (patch) | |
| tree | d6132a3b7d9a3eaf360ba13bb22d70c7cbc165f8 /runtime/lua | |
| parent | 2c5f37f6af962bc9ed65ca87b8272800badfb78f (diff) | |
| download | rneovim-dadaa7fcade459ebd1fef2ee4eada1a389ea036d.tar.gz rneovim-dadaa7fcade459ebd1fef2ee4eada1a389ea036d.tar.bz2 rneovim-dadaa7fcade459ebd1fef2ee4eada1a389ea036d.zip | |
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.
Diffstat (limited to 'runtime/lua')
| -rw-r--r-- | runtime/lua/vim/_core/ui2/messages.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/lua/vim/_core/ui2/messages.lua b/runtime/lua/vim/_core/ui2/messages.lua index 9178b7857f..2421647a81 100644 --- a/runtime/lua/vim/_core/ui2/messages.lua +++ b/runtime/lua/vim/_core/ui2/messages.lua @@ -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 |