Skip to content

Commit

Permalink
fix: nil problem when jump to location when tab drop is set as `jum…
Browse files Browse the repository at this point in the history
…p_type` (#2760)

* feat(lsp_definitions): adding `tab drop` as `jump_type`

* feat(lsp-jump-types): `tab drop` for LSP features

Now, you're able to use `tab drop` as `jump_type` for these LSP
features: references, type definitions, definitions an implementations.

* fix(docs): reordering `tab drop` option

* feat: generate docs

* fix: nil problem with `vim.uri_to_fname`

* fix: removing warning about `file_uri` variable not being used

---------

Co-authored-by: Simon Hauser <[email protected]>
  • Loading branch information
HicaroD and Conni2461 authored Nov 6, 2023
1 parent 4522d7e commit 20bf205
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/telescope/builtin/__lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,11 @@ local function list_or_jump(action, title, opts)
elseif opts.jump_type == "vsplit" then
vim.cmd "vnew"
elseif opts.jump_type == "tab drop" then
local file_path = vim.uri_to_fname(flattened_results[1].uri)
local file_uri = flattened_results[1].uri
if file_uri == nil then
file_uri = flattened_results[1].targetUri
end
local file_path = vim.uri_to_fname(file_uri)
vim.cmd("tab drop " .. file_path)
end
end
Expand Down

0 comments on commit 20bf205

Please sign in to comment.