File tree Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -304,19 +304,23 @@ function cmd.open()
304304 local q = utils .curr_question ()
305305
306306 if q then
307- local command
308- local os_name = vim .loop .os_uname ().sysname
309-
310- if os_name == " Linux" then
311- command = string.format (" xdg-open '%s'" , q .cache .link )
312- elseif os_name == " Darwin" then
313- command = string.format (" open '%s'" , q .cache .link )
307+ if vim .ui .open then
308+ vim .ui .open (q .cache .link )
314309 else
315- -- Fallback to Windows if uname is not available or does not match Linux/Darwin.
316- command = string.format (" start \"\" \" %s\" " , q .cache .link )
317- end
310+ local command
311+ local os_name = vim .loop .os_uname ().sysname
312+
313+ if os_name == " Linux" then
314+ command = string.format (" xdg-open '%s'" , q .cache .link )
315+ elseif os_name == " Darwin" then
316+ command = string.format (" open '%s'" , q .cache .link )
317+ else
318+ -- Fallback to Windows if uname is not available or does not match Linux/Darwin.
319+ command = string.format (" start \"\" \" %s\" " , q .cache .link )
320+ end
318321
319- vim .fn .jobstart (command , { detach = true })
322+ vim .fn .jobstart (command , { detach = true })
323+ end
320324 end
321325end
322326
You can’t perform that action at this time.
0 commit comments