fix(cache): dont update rtp in fast events

This commit is contained in:
Folke Lemaitre 2022-12-29 01:04:39 +01:00
parent 6c0b803999
commit 4b75d06c07
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 4 additions and 1 deletions

View File

@ -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