diff options
| author | Volodymyr Chernetskyi <volodymyr_chernetskyi@goodyear.com> | 2026-09-02 22:58:26 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-02 16:58:26 -0400 |
| commit | 10fa98bb6e086ff498d4bfecd4b0cdbb802d079b (patch) | |
| tree | b4c8732f00e528918c12673f40b7981daa80e5fe /runtime/lua | |
| parent | 45b645718c804b66394231f85f52413218fdafbd (diff) | |
| download | rneovim-10fa98bb6e086ff498d4bfecd4b0cdbb802d079b.tar.gz rneovim-10fa98bb6e086ff498d4bfecd4b0cdbb802d079b.tar.bz2 rneovim-10fa98bb6e086ff498d4bfecd4b0cdbb802d079b.zip | |
fix(pack): read document links from the request buffer #41638
Problem:
The `textDocument/documentLink` handler resolves the confirmation buffer
from the request URI and checks it for `nil`, then reads lines from
buffer `0`. When the confirmation buffer is not current, links are
computed from unrelated text and returned against the confirmation
buffer's line numbers, producing missing or misplaced links.
Solution:
Read lines from the resolved `bufnr`.
AI-assisted
Diffstat (limited to 'runtime/lua')
| -rw-r--r-- | runtime/lua/vim/pack/_lsp.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/lua/vim/pack/_lsp.lua b/runtime/lua/vim/pack/_lsp.lua index 1c32076b7e..223ede8197 100644 --- a/runtime/lua/vim/pack/_lsp.lua +++ b/runtime/lua/vim/pack/_lsp.lua @@ -122,7 +122,7 @@ methods['textDocument/documentLink'] = function(params, callback) --- @type vim.pack.lsp.DocumentLink[] local links = {} local cur_src = '' - local lines = vim.api.nvim_buf_get_lines(0, 0, -1, false) + local lines = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false) for i, l in ipairs(lines) do cur_src = l:match('^Source: +(.+)$') or cur_src |