aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/util.lua
diff options
context:
space:
mode:
authorMichael Lingelbach <m.j.lbach@gmail.com>2022-01-02 01:55:16 -0500
committerGitHub <noreply@github.com>2022-01-02 07:55:16 +0100
commite42c9065972f93e4666fbd8e06fc56333e9e5d24 (patch)
tree53f8bb6ec7247bc7ccbcd886cdf1b24176120cc4 /runtime/lua/vim/lsp/util.lua
parent838631e29ef3051d6117b3d5c340d2be9f1f29b4 (diff)
downloadrneovim-e42c9065972f93e4666fbd8e06fc56333e9e5d24.tar.gz
rneovim-e42c9065972f93e4666fbd8e06fc56333e9e5d24.tar.bz2
rneovim-e42c9065972f93e4666fbd8e06fc56333e9e5d24.zip
fix(lsp): always use target bufnr in location handler (#16876)
Diffstat (limited to 'runtime/lua/vim/lsp/util.lua')
-rw-r--r--runtime/lua/vim/lsp/util.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua
index 5921eb5bf0..ae667c4106 100644
--- a/runtime/lua/vim/lsp/util.lua
+++ b/runtime/lua/vim/lsp/util.lua
@@ -1000,10 +1000,10 @@ function M.jump_to_location(location)
--- Jump to new location (adjusting for UTF-16 encoding of characters)
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 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})
-- Open folds under the cursor
vim.cmd("normal! zv")