diff --git a/lua/lsplinks.lua b/lua/lsplinks.lua index 9766790..f4e35a5 100644 --- a/lua/lsplinks.lua +++ b/lua/lsplinks.lua @@ -54,34 +54,13 @@ local function lsp_has_capability(name) end ---@param uri string -local function open_file(uri) +local function open_uri(uri) local file_uri, line_no, col_no = uri:match("(.-)#(%d+),(%d+)") if file_uri then vim.lsp.util.jump_to_location({ uri = file_uri }, "utf-8", true) api.nvim_win_set_cursor(0, { tonumber(line_no), tonumber(col_no) - 1 }) else - vim.lsp.util.jump_to_location({ uri = uri }, "utf-8", true) - end -end - ----@param uri string -local function open_browser(uri) - local quoted_uri = '"' .. uri .. '"' - if jit.os == "Windows" then - vim.fn.system("start " .. quoted_uri) - elseif jit.os == "OSX" then - vim.fn.system("open " .. quoted_uri) - else - vim.fn.system("xdg-open " .. quoted_uri) - end -end - ----@param uri string -local function open_uri(uri) - if uri:match("^file://") then - open_file(uri) - else - open_browser(uri) + vim.ui.open(uri) end end