From b7c489b08f79765b7c840addc4e542b875438f47 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 21 Dec 2022 16:27:56 +0100 Subject: [PATCH] fix(loader): lua modules can be links instead of files. Fixes #66 --- lua/lazy/core/loader.lua | 2 +- lua/lazy/core/util.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/lazy/core/loader.lua b/lua/lazy/core/loader.lua index 931cf4c..c4b0df2 100644 --- a/lua/lazy/core/loader.lua +++ b/lua/lazy/core/loader.lua @@ -172,7 +172,7 @@ function M.source_runtime(...) Util.walk(dir, function(path, name, t) local ext = name:sub(-3) name = name:sub(1, -5) - if t == "file" and (ext == "lua" or ext == "vim") and not M.disabled_rtp_plugins[name] then + if (t == "file" or t == "link") and (ext == "lua" or ext == "vim") and not M.disabled_rtp_plugins[name] then files[#files + 1] = path end end) diff --git a/lua/lazy/core/util.lua b/lua/lazy/core/util.lua index 50d207e..4f79800 100644 --- a/lua/lazy/core/util.lua +++ b/lua/lazy/core/util.lua @@ -173,7 +173,7 @@ function M.lsmod(modname, root, fn) fn(modname, root .. ".lua") end M.ls(root, function(path, name, type) - if type == "file" and name:sub(-4) == ".lua" then + if (type == "file" or type == "link") and name:sub(-4) == ".lua" then if name == "init.lua" then fn(modname, path) else