Skip to content

Commit 66466a2

Browse files
committed
feat(util): option to force system app for util.open
1 parent 8134f2a commit 66466a2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lua/lazy/util.lua

+5-3
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@ function M.wo(win, k, v)
1919
end
2020
end
2121

22-
function M.open(uri)
23-
if M.file_exists(uri) then
22+
---@param opts? {system?:boolean}
23+
function M.open(uri, opts)
24+
opts = opts or {}
25+
if not opts.system and M.file_exists(uri) then
2426
return M.float({ style = "", file = uri })
2527
end
2628
local Config = require("lazy.core.config")
2729
local cmd
28-
if Config.options.ui.browser then
30+
if not opts.system and Config.options.ui.browser then
2931
cmd = { Config.options.ui.browser, uri }
3032
elseif vim.fn.has("win32") == 1 then
3133
cmd = { "explorer", uri }

0 commit comments

Comments
 (0)