From 95b9cf743c4d6aab879c2259b79346c6f306dab8 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 29 Dec 2022 01:25:05 +0100 Subject: [PATCH] fix(cache): properly get rtp during fast events --- lua/lazy/core/cache.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lua/lazy/core/cache.lua b/lua/lazy/core/cache.lua index e0144c4..db57317 100644 --- a/lua/lazy/core/cache.lua +++ b/lua/lazy/core/cache.lua @@ -241,7 +241,7 @@ function M.find(modname) local modpath = _find() if not modpath then -- update rtp - local rtp = vim.api.nvim_list_runtime_paths() + local rtp = M.list_rtp() if #rtp ~= M.indexed_rtp then M.indexed_rtp = #rtp local updated = false @@ -283,10 +283,7 @@ end -- returns the cached RTP excluding plugin dirs function M.get_rtp() - if vim.in_fast_event() then - return M.rtp or {} - end - local rtp = vim.api.nvim_list_runtime_paths() + local rtp = M.list_rtp() if not M.rtp or #rtp ~= M.rtp_total then M.rtp_total = #rtp M.rtp = {} @@ -313,6 +310,10 @@ function M.get_rtp() return M.rtp end +function M.list_rtp() + return vim.api.nvim_get_runtime_file("", true) +end + ---@param opts? LazyConfig function M.setup(opts) -- no fancy deep extend here. just set the options