diff options
author | Michael Lingelbach <m.j.lbach@gmail.com> | 2022-01-15 15:49:29 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-15 15:49:29 -0800 |
commit | a0201b6ed37bae594bd0db2804c8ecff09a29e0e (patch) | |
tree | bf03fe367316525bbd81b41f80a8b482d8dbc138 /runtime/lua/vim/lsp/handlers.lua | |
parent | 561df30981461a0e20966839c716f07665b107c0 (diff) | |
download | rneovim-a0201b6ed37bae594bd0db2804c8ecff09a29e0e.tar.gz rneovim-a0201b6ed37bae594bd0db2804c8ecff09a29e0e.tar.bz2 rneovim-a0201b6ed37bae594bd0db2804c8ecff09a29e0e.zip |
fix(lsp): fetch offset_encoding from client in references (#17104)
Diffstat (limited to 'runtime/lua/vim/lsp/handlers.lua')
-rw-r--r-- | runtime/lua/vim/lsp/handlers.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/lua/vim/lsp/handlers.lua b/runtime/lua/vim/lsp/handlers.lua index c0843e1577..36ab6d59dd 100644 --- a/runtime/lua/vim/lsp/handlers.lua +++ b/runtime/lua/vim/lsp/handlers.lua @@ -166,18 +166,19 @@ M['textDocument/references'] = function(_, result, ctx, config) if not result or vim.tbl_isempty(result) then vim.notify('No references found') else + local client = vim.lsp.get_client_by_id(ctx.client_id) config = config or {} if config.loclist then vim.fn.setloclist(0, {}, ' ', { title = 'References'; - items = util.locations_to_items(result, ctx.offset_encoding); + items = util.locations_to_items(result, client.offset_encoding); context = ctx; }) api.nvim_command("lopen") else vim.fn.setqflist({}, ' ', { title = 'References'; - items = util.locations_to_items(result, ctx.offset_encoding); + items = util.locations_to_items(result, client.offset_encoding); context = ctx; }) api.nvim_command("botright copen") |