implement open_url_in_browser() for windows

This commit is contained in:
2022-04-01 10:40:10 +03:00
parent ed6d81ef53
commit 4448a1ae8e

View File

@@ -52,13 +52,14 @@ M.lsp_organize_imports = function(bufnr, timeout)
end end
M.open_url_in_browser = function(url) M.open_url_in_browser = function(url)
-- TODO: implement windows support local f
if vim.fn.has("win32") == 1 then if vim.fn.has("win32") == 1 then
print("windows not supported, sorry") f = io.popen("explorer " .. url, "r")
return else
f = io.popen("xdg-open " .. url, "r")
end end
local f = io.popen("xdg-open " .. url, "r")
f:close() f:close()
end end