From 62a47b921fbffb3c1c8088a731029ae234f98851 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 24 Jun 2024 23:42:51 +0200 Subject: [PATCH] fix(loader): no need to check plugin.dir in auto_load --- lua/lazy/core/loader.lua | 2 +- lua/lazy/pkg/init.lua | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lua/lazy/core/loader.lua b/lua/lazy/core/loader.lua index 7209362..597933b 100644 --- a/lua/lazy/core/loader.lua +++ b/lua/lazy/core/loader.lua @@ -525,7 +525,7 @@ end function M.auto_load(modname, modpath) local plugin = Plugin.find(modpath, { fast = not M.did_handlers }) - if plugin and modpath:find(plugin.dir, 1, true) == 1 then + if plugin then plugin._.rtp_loaded = true -- don't load if: -- * handlers haven't been setup yet diff --git a/lua/lazy/pkg/init.lua b/lua/lazy/pkg/init.lua index a81ab9c..b9620ca 100644 --- a/lua/lazy/pkg/init.lua +++ b/lua/lazy/pkg/init.lua @@ -1,5 +1,5 @@ local Config = require("lazy.core.config") -local Util = require("lazy.util") +local Util = require("lazy.core.util") local M = {} M.VERSION = 10 @@ -71,9 +71,10 @@ function M.update() table.sort(ret.pkgs, function(a, b) return a.name < b.name end) - local code = "return " .. Util.dump(ret) + local U = require("lazy.util") + local code = "return " .. U.dump(ret) vim.fn.mkdir(vim.fn.fnamemodify(Config.options.pkg.cache, ":h"), "p") - Util.write_file(Config.options.pkg.cache, code) + U.write_file(Config.options.pkg.cache, code) M.dirty = false M.cache = nil end