From 66466a2594ab0c446193772a68c236c7e4e02ade Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 22 Mar 2024 23:35:19 +0100 Subject: [PATCH] feat(util): option to force system app for util.open --- lua/lazy/util.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lua/lazy/util.lua b/lua/lazy/util.lua index 1c73d439..a3b94f64 100644 --- a/lua/lazy/util.lua +++ b/lua/lazy/util.lua @@ -19,13 +19,15 @@ function M.wo(win, k, v) end end -function M.open(uri) - if M.file_exists(uri) then +---@param opts? {system?:boolean} +function M.open(uri, opts) + opts = opts or {} + if not opts.system and M.file_exists(uri) then return M.float({ style = "", file = uri }) end local Config = require("lazy.core.config") local cmd - if Config.options.ui.browser then + if not opts.system and Config.options.ui.browser then cmd = { Config.options.ui.browser, uri } elseif vim.fn.has("win32") == 1 then cmd = { "explorer", uri }