refactor(cache): revert all vim.cache changes and disable it if it would ever exist

This commit is contained in:
Folke Lemaitre 2023-03-15 09:01:00 +01:00
commit 21a219a825
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
6 changed files with 14 additions and 25 deletions

View file

@ -33,11 +33,13 @@ function M.setup(spec, opts)
end
local start = vim.loop.hrtime()
-- poly-fill vim.cache
if not vim.cache then
vim.cache = require("lazy.core.cache")
-- disable the Neovim cache if it would ever be added
if vim.cache and vim.cache.disable then
vim.cache.disable()
end
local Cache = require("lazy.core.cache")
local enable_cache = not (
opts
and opts.performance
@ -46,7 +48,7 @@ function M.setup(spec, opts)
)
-- load module cache before anything else
if enable_cache then
vim.cache.enable()
Cache.enable()
end
require("lazy.stats").track("LazyStart")
@ -58,7 +60,7 @@ function M.setup(spec, opts)
table.insert(package.loaders, 3, Loader.loader)
if vim.g.profile_loaders then
vim.cache.profile_loaders()
Cache.profile_loaders()
end
Util.track({ plugin = "lazy.nvim" }) -- setup start