fix: use lazy's util.open instead

This commit is contained in:
Folke Lemaitre 2024-03-22 23:38:04 +01:00
parent e91fa6eaf5
commit a95458e1e3
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -69,16 +69,12 @@ return {
end,
desc = "copy path to clipboard",
},
["O"] = vim.ui.open and {
["O"] = {
function(state)
local path = state.tree:get_node().path
local ret = vim.ui.open(path)
if ret and ret.code ~= 0 then
require("lazyvim.util").error("Failed to open file: " .. ret.stderr .. "\n .. " .. ret.stdout)
end
require("lazy.util").open(state.tree:get_node().path, { system = true })
end,
desc = "open with system default application",
} or nil,
desc = "open with system application",
},
},
},
default_component_configs = {