From 4b75d06c076745379fb1688d2bd00eeabeaa4a4b Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 29 Dec 2022 01:04:39 +0100 Subject: [PATCH] fix(cache): dont update rtp in fast events --- lua/lazy/core/cache.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/lazy/core/cache.lua b/lua/lazy/core/cache.lua index 7602a0d..e0144c4 100644 --- a/lua/lazy/core/cache.lua +++ b/lua/lazy/core/cache.lua @@ -283,6 +283,9 @@ 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() if not M.rtp or #rtp ~= M.rtp_total then M.rtp_total = #rtp @@ -299,7 +302,7 @@ function M.get_rtp() end end end - for _, path in ipairs(vim.api.nvim_list_runtime_paths()) do + for _, path in ipairs(rtp) do ---@type string path = path:gsub("\\", "/") if not skip[path] and not path:find("after/?$") then