mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-07 08:16:35 +00:00
Update util.lua
This commit is contained in:
parent
5f10bb0e00
commit
f6090f634d
1 changed files with 9 additions and 7 deletions
|
@ -26,13 +26,6 @@ function M.open(uri, opts)
|
||||||
return M.float({ style = "", file = uri })
|
return M.float({ style = "", file = uri })
|
||||||
end
|
end
|
||||||
if vim.fn.has('nvim-0.10.0') == 1 then
|
if vim.fn.has('nvim-0.10.0') == 1 then
|
||||||
local ret = vim.fn.jobstart(cmd, { detach = true })
|
|
||||||
if ret <= 0 then
|
|
||||||
local msg = {
|
|
||||||
"Failed to open uri",
|
|
||||||
ret,
|
|
||||||
vim.inspect(cmd),
|
|
||||||
}
|
|
||||||
local cmd, err = vim.ui.open(uri)
|
local cmd, err = vim.ui.open(uri)
|
||||||
if cmd then
|
if cmd then
|
||||||
cmd:wait()
|
cmd:wait()
|
||||||
|
@ -65,6 +58,15 @@ function M.open(uri, opts)
|
||||||
cmd = { "open", uri }
|
cmd = { "open", uri }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
local ret = vim.fn.jobstart(cmd, { detach = true })
|
||||||
|
if ret <= 0 then
|
||||||
|
local msg = {
|
||||||
|
"Failed to open uri",
|
||||||
|
ret,
|
||||||
|
vim.inspect(cmd),
|
||||||
|
}
|
||||||
|
vim.notify(table.concat(msg, "\n"), vim.log.levels.ERROR)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue