I had previously hard-coded the path on my Debian install, but this commit will find the correct JAR file as long as there is a `plantuml` launch script in the PATH.
26 lines
626 B
Lua
26 lines
626 B
Lua
return {
|
|
"weirongxu/plantuml-previewer.vim",
|
|
|
|
dependencies = {
|
|
"tyru/open-browser.vim",
|
|
},
|
|
|
|
cmd = {
|
|
"PlantumlOpen",
|
|
"PlantumlStart",
|
|
"PlantumlStop",
|
|
"PlantumlSave",
|
|
},
|
|
|
|
ft = "plantuml",
|
|
|
|
init = function()
|
|
-- Prefer the system PlantUML (if any) over the one bundled with the plugin.
|
|
local cmdline = [[which plantuml | xargs cat | grep plantuml.jar]]
|
|
local regex = [[\v\s['"]?(\S+/plantuml\.jar)]]
|
|
local jar = vim.fn.matchlist(vim.fn.system(cmdline), regex)[2]
|
|
if jar and vim.loop.fs_stat(jar) then
|
|
vim.g["plantuml_previewer#plantuml_jar_path"] = jar
|
|
end
|
|
end,
|
|
}
|