mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
Make "O" undefined mapping if vim.ui.open isn't available
This commit is contained in:
parent
184807bef2
commit
e91fa6eaf5
1 changed files with 8 additions and 9 deletions
|
|
@ -69,17 +69,16 @@ return {
|
||||||
end,
|
end,
|
||||||
desc = "copy path to clipboard",
|
desc = "copy path to clipboard",
|
||||||
},
|
},
|
||||||
["O"] = {
|
["O"] = vim.ui.open and {
|
||||||
command = function(state)
|
function(state)
|
||||||
if vim.ui.open then
|
local path = state.tree:get_node().path
|
||||||
local filepath = state.tree:get_node().path
|
local ret = vim.ui.open(path)
|
||||||
vim.ui.open(filepath)
|
if ret and ret.code ~= 0 then
|
||||||
else
|
require("lazyvim.util").error("Failed to open file: " .. ret.stderr .. "\n .. " .. ret.stdout)
|
||||||
require("lazyvim.util").error("vim.ui.open is not available")
|
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
desc = "open_with_system_default",
|
desc = "open with system default application",
|
||||||
},
|
} or nil,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default_component_configs = {
|
default_component_configs = {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue