From 79f85e5fed3ea020b09720e273c8b626f699b19a Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 28 Feb 2023 12:38:10 +0100 Subject: [PATCH] fix(cache): add hack to work-around incorrect requires back. Not a fan of this. Fixes #603 --- lua/lazy/core/cache.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lua/lazy/core/cache.lua b/lua/lazy/core/cache.lua index 6f7c4f5..c9313cd 100644 --- a/lua/lazy/core/cache.lua +++ b/lua/lazy/core/cache.lua @@ -231,6 +231,12 @@ function Cache.find(modname, opts) local basename = modname:gsub("%.", "/") local idx = modname:find(".", 1, true) + -- HACK: fix incorrect require statements. Really not a fan of keeping this + 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 -- OPTIM: search for a directory first when topmod == modname