Skip to content

Commit

Permalink
fix(loader): no need to check plugin.dir in auto_load
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jun 24, 2024
1 parent 9bcbbc1 commit 62a47b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lua/lazy/core/loader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions lua/lazy/pkg/init.lua
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 62a47b9

Please sign in to comment.