feat: lazy caching now works with functions that have upvalues

This commit is contained in:
Folke Lemaitre 2022-11-25 15:35:40 +01:00
parent 48199f8031
commit fe33e4e3dd
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
9 changed files with 161 additions and 187 deletions

View file

@ -36,21 +36,7 @@ function M.setup(opts)
Util.track()
Util.track("state")
if not State.load() then
local Plugin = require("lazy.plugin")
vim.schedule(function()
Util.info("Reloading...")
end)
Util.track("reload")
Plugin.reload()
Util.track()
-- if not Config.plugins.lazy then
-- Plugin.plugin({
-- "folke/lazy.nvim",
-- opt = false,
-- })
-- end
end
State.load()
Util.track()
Util.track("install")
@ -59,6 +45,7 @@ function M.setup(opts)
vim.cmd("do User LazyInstallPre")
require("lazy.manager").install({
wait = true,
show = Config.options.interactive,
})
break
end
@ -75,7 +62,7 @@ function M.setup(opts)
Loader.init_plugins()
Config.plugins.lazy.loaded.time = lazy_delta
Config.plugins["lazy.nvim"].loaded.time = lazy_delta
done = true
vim.cmd("do User LazyDone")