Skip to content

Commit 95b9cf7

Browse files
committed
fix(cache): properly get rtp during fast events
1 parent 5533513 commit 95b9cf7

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lua/lazy/core/cache.lua

+6-5
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ function M.find(modname)
241241
local modpath = _find()
242242
if not modpath then
243243
-- update rtp
244-
local rtp = vim.api.nvim_list_runtime_paths()
244+
local rtp = M.list_rtp()
245245
if #rtp ~= M.indexed_rtp then
246246
M.indexed_rtp = #rtp
247247
local updated = false
@@ -283,10 +283,7 @@ end
283283

284284
-- returns the cached RTP excluding plugin dirs
285285
function M.get_rtp()
286-
if vim.in_fast_event() then
287-
return M.rtp or {}
288-
end
289-
local rtp = vim.api.nvim_list_runtime_paths()
286+
local rtp = M.list_rtp()
290287
if not M.rtp or #rtp ~= M.rtp_total then
291288
M.rtp_total = #rtp
292289
M.rtp = {}
@@ -313,6 +310,10 @@ function M.get_rtp()
313310
return M.rtp
314311
end
315312

313+
function M.list_rtp()
314+
return vim.api.nvim_get_runtime_file("", true)
315+
end
316+
316317
---@param opts? LazyConfig
317318
function M.setup(opts)
318319
-- no fancy deep extend here. just set the options

0 commit comments

Comments
 (0)