mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-18 20:36:45 +00:00
perf: disable cache by default on VimEnter or on BufReadPre
This commit is contained in:
parent
c1e44cbc3f
commit
b2727d98a3
2 changed files with 10 additions and 34 deletions
|
@ -8,10 +8,9 @@ function M.setup(spec, opts)
|
|||
end
|
||||
local start = vim.loop.hrtime()
|
||||
|
||||
local Cache
|
||||
if not (opts and opts.performance and opts.performance.cache and opts.performance.cache.enabled == false) then
|
||||
-- load module cache before anything else
|
||||
Cache = require("lazy.core.cache").setup(opts)
|
||||
require("lazy.core.cache").setup(opts)
|
||||
end
|
||||
|
||||
local Util = require("lazy.core.util")
|
||||
|
@ -40,17 +39,9 @@ function M.setup(spec, opts)
|
|||
Config.plugins["lazy.nvim"]._.loaded = { time = delta, source = "init.lua" }
|
||||
end
|
||||
|
||||
if Cache then
|
||||
Cache.disable("lazy")
|
||||
end
|
||||
|
||||
-- load plugins with lazy=false or Plugin.init
|
||||
Loader.init_plugins()
|
||||
|
||||
if Cache then
|
||||
Cache.disable("init")
|
||||
end
|
||||
|
||||
-- all done!
|
||||
vim.cmd("do User LazyDone")
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue