fix (nightly): add offset encoding to vim.lsp.util.jump_to_location() call (#1688)

This commit is contained in:
Chinmay Dalal
2022-01-14 21:24:23 +05:30
committed by GitHub
parent 015a35626d
commit 3bf4d4b4d0

View File

@@ -47,7 +47,7 @@ local function list_or_jump(action, title, opts)
opts = opts or {} opts = opts or {}
local params = vim.lsp.util.make_position_params() local params = vim.lsp.util.make_position_params()
vim.lsp.buf_request(0, action, params, function(err, result, _ctx, _config) vim.lsp.buf_request(0, action, params, function(err, result, ctx, _config)
if err then if err then
vim.api.nvim_err_writeln("Error when executing " .. action .. " : " .. err.message) vim.api.nvim_err_writeln("Error when executing " .. action .. " : " .. err.message)
return return
@@ -72,7 +72,7 @@ local function list_or_jump(action, title, opts)
elseif opts.jump_type == "vsplit" then elseif opts.jump_type == "vsplit" then
vim.cmd "vnew" vim.cmd "vnew"
end end
vim.lsp.util.jump_to_location(flattened_results[1]) vim.lsp.util.jump_to_location(flattened_results[1], vim.lsp.get_client_by_id(ctx.client_id).offset_encoding)
else else
local locations = vim.lsp.util.locations_to_items(flattened_results) local locations = vim.lsp.util.locations_to_items(flattened_results)
pickers.new(opts, { pickers.new(opts, {