mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-18 20:36:45 +00:00
feat(cache): use vim.cache
everywhere. poly-fill when needed
This commit is contained in:
parent
4446d69c28
commit
ea1a044e3c
6 changed files with 14 additions and 15 deletions
|
@ -33,15 +33,20 @@ function M.setup(spec, opts)
|
|||
end
|
||||
local start = vim.loop.hrtime()
|
||||
|
||||
-- load module cache before anything else
|
||||
-- poly-fill vim.cache
|
||||
if not vim.cache then
|
||||
vim.cache = require("lazy.core.cache")
|
||||
end
|
||||
|
||||
local enable_cache = not (
|
||||
opts
|
||||
and opts.performance
|
||||
and opts.performance.cache
|
||||
and opts.performance.cache.enabled == false
|
||||
)
|
||||
-- load module cache before anything else
|
||||
if enable_cache then
|
||||
require("lazy.core.cache").enable()
|
||||
vim.cache.enable()
|
||||
end
|
||||
|
||||
require("lazy.stats").track("LazyStart")
|
||||
|
@ -53,7 +58,7 @@ function M.setup(spec, opts)
|
|||
table.insert(package.loaders, 3, Loader.loader)
|
||||
|
||||
if vim.g.profile_loaders then
|
||||
require("lazy.core.cache").profile_loaders()
|
||||
vim.cache.profile_loaders()
|
||||
end
|
||||
|
||||
Util.track({ plugin = "lazy.nvim" }) -- setup start
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue