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, end,
desc = "copy path to clipboard", desc = "copy path to clipboard",
}, },
["O"] = vim.ui.open and { ["O"] = {
function(state) function(state)
local path = state.tree:get_node().path require("lazy.util").open(state.tree:get_node().path, { system = true })
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
end, end,
desc = "open with system default application", desc = "open with system application",
} or nil, },
}, },
}, },
default_component_configs = { default_component_configs = {