mirror of https://github.com/folke/lazy.nvim.git
fix(cache): hack to work around plugins trying to load relatve modules. Fixes #543
This commit is contained in:
parent
4a0857cc23
commit
e916f41df2
|
@ -230,6 +230,14 @@ function Cache.find(modname, opts)
|
||||||
modname = modname:gsub("/", ".")
|
modname = modname:gsub("/", ".")
|
||||||
local basename = modname:gsub("%.", "/")
|
local basename = modname:gsub("%.", "/")
|
||||||
local idx = modname:find(".", 1, true)
|
local idx = modname:find(".", 1, true)
|
||||||
|
|
||||||
|
-- HACK: some plugins try to load invalid relative paths (see #543)
|
||||||
|
if idx == 1 then
|
||||||
|
modname = modname:gsub("^%.+", "")
|
||||||
|
basename = modname:gsub("%.", "/")
|
||||||
|
idx = modname:find(".", 1, true)
|
||||||
|
end
|
||||||
|
|
||||||
local topmod = idx and modname:sub(1, idx - 1) or modname
|
local topmod = idx and modname:sub(1, idx - 1) or modname
|
||||||
|
|
||||||
-- OPTIM: search for a directory first when topmod == modname
|
-- OPTIM: search for a directory first when topmod == modname
|
||||||
|
|
Loading…
Reference in New Issue