Fix ordering of wsl and win

This commit is contained in:
ec965 2022-10-06 22:48:35 -07:00
parent 868fdb39e9
commit 16fd0ed499

View file

@ -80,20 +80,30 @@ end
-- opens a url in the correct OS
function M.open_url(url)
if vim.fn.has("mac") then
-- order here matters
-- wsl must come before win
-- wsl must come before linux
if vim.fn.has("mac") == 1 then
vim.fn.system("open " .. url)
return true
elseif vim.fn.has("win64") or vim.fn.has("win32") then
vim.fn.system("start " .. url)
return true
elseif vim.fn.has("wsl") then
end
if vim.fn.has("wsl") == 1 then
vim.fn.system("explorer.exe " .. url)
return true
elseif vim.fn.has("linux") then
end
if vim.fn.has("win64") == 1 or vim.fn.has("win32") == 1 then
vim.fn.system("start " .. url)
return true
end
if vim.fn.has("linux") == 1 then
vim.fn.system("xdg-open " .. url)
return true
end
return false
end