feat(lsp-jump-type): tab drop as new jump_type option for go-to LSP pickers (#2751)

This commit is contained in:
Hicro
2023-10-23 04:41:29 -03:00
committed by GitHub
parent 74ce793a60
commit 060fedfdea
3 changed files with 17 additions and 12 deletions

View File

@@ -47,6 +47,8 @@ lsp.references = function(opts)
vim.cmd "new"
elseif opts.jump_type == "vsplit" then
vim.cmd "vnew"
elseif opts.jump_type == "tab drop" then
vim.cmd("tab drop " .. locations[1].filename)
end
end
-- jump to location
@@ -197,6 +199,9 @@ local function list_or_jump(action, title, opts)
vim.cmd "new"
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)
vim.cmd("tab drop " .. file_path)
end
end