mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 11:58:17 +00:00
fix(lsp): always use target bufnr in location handler (#16876)
This commit is contained in:

committed by
GitHub

parent
838631e29e
commit
e42c906597
@@ -1000,10 +1000,10 @@ function M.jump_to_location(location)
|
|||||||
|
|
||||||
--- Jump to new location (adjusting for UTF-16 encoding of characters)
|
--- Jump to new location (adjusting for UTF-16 encoding of characters)
|
||||||
api.nvim_set_current_buf(bufnr)
|
api.nvim_set_current_buf(bufnr)
|
||||||
api.nvim_buf_set_option(0, 'buflisted', true)
|
api.nvim_buf_set_option(bufnr, 'buflisted', true)
|
||||||
local range = location.range or location.targetSelectionRange
|
local range = location.range or location.targetSelectionRange
|
||||||
local row = range.start.line
|
local row = range.start.line
|
||||||
local col = get_line_byte_from_position(0, range.start)
|
local col = get_line_byte_from_position(bufnr, range.start)
|
||||||
api.nvim_win_set_cursor(0, {row + 1, col})
|
api.nvim_win_set_cursor(0, {row + 1, col})
|
||||||
-- Open folds under the cursor
|
-- Open folds under the cursor
|
||||||
vim.cmd("normal! zv")
|
vim.cmd("normal! zv")
|
||||||
|
Reference in New Issue
Block a user