@@ -29,18 +29,26 @@ function M.open(uri, opts)
29
29
local cmd
30
30
if not opts .system and Config .options .ui .browser then
31
31
cmd = { Config .options .ui .browser , uri }
32
- elseif vim .fn .has (" win32" ) == 1 then
33
- cmd = { " explorer" , uri }
34
- elseif vim .fn .has (" macunix" ) == 1 then
32
+ elseif vim .fn .has (" mac" ) == 1 then
35
33
cmd = { " open" , uri }
36
- else
37
- if vim .fn .executable (" xdg-open" ) == 1 then
38
- cmd = { " xdg-open" , uri }
39
- elseif vim .fn .executable (" wslview" ) == 1 then
40
- cmd = { " wslview" , uri }
34
+ elseif vim .fn .has (" win32" ) == 1 then
35
+ if vim .fn .executable (" rundll32" ) == 1 then
36
+ cmd = { " rundll32" , " url.dll,FileProtocolHandler" , uri }
41
37
else
42
- cmd = { " open" , uri }
38
+ vim .notify (" rundll32 not found" , vim .log .levels .ERROR )
39
+ return
43
40
end
41
+ elseif vim .fn .executable (" xdg-open" ) == 1 then
42
+ cmd = { " xdg-open" , uri }
43
+ elseif vim .fn .executable (" wslview" ) == 1 then
44
+ cmd = { " wslview" , uri }
45
+ elseif vim .fn .executable (" explorer.exe" ) == 1 then
46
+ cmd = { " explorer.exe" , uri }
47
+ elseif vim .fn .executable (" lemonade" ) == 1 then
48
+ cmd = { " lemonade" , " open" , uri }
49
+ else
50
+ vim .notify (" no handler found (tried: wslview, explorer.exe, xdg-open, lemonade)" , vim .log .levels .ERROR )
51
+ return
44
52
end
45
53
46
54
local ret = vim .fn .jobstart (cmd , { detach = true })
0 commit comments