mirror of https://github.com/folke/lazy.nvim.git
fix(loader): no need to check plugin.dir in auto_load
This commit is contained in:
parent
9bcbbc17a7
commit
62a47b921f
|
@ -525,7 +525,7 @@ end
|
||||||
|
|
||||||
function M.auto_load(modname, modpath)
|
function M.auto_load(modname, modpath)
|
||||||
local plugin = Plugin.find(modpath, { fast = not M.did_handlers })
|
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
|
plugin._.rtp_loaded = true
|
||||||
-- don't load if:
|
-- don't load if:
|
||||||
-- * handlers haven't been setup yet
|
-- * handlers haven't been setup yet
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
local Config = require("lazy.core.config")
|
local Config = require("lazy.core.config")
|
||||||
local Util = require("lazy.util")
|
local Util = require("lazy.core.util")
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
M.VERSION = 10
|
M.VERSION = 10
|
||||||
|
@ -71,9 +71,10 @@ function M.update()
|
||||||
table.sort(ret.pkgs, function(a, b)
|
table.sort(ret.pkgs, function(a, b)
|
||||||
return a.name < b.name
|
return a.name < b.name
|
||||||
end)
|
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")
|
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.dirty = false
|
||||||
M.cache = nil
|
M.cache = nil
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue