mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-07-02 13:34:44 +02:00
refactor: new cache
This commit is contained in:
parent
e115f5ec17
commit
983e1c5e34
6 changed files with 237 additions and 177 deletions
|
@ -242,9 +242,11 @@ end
|
|||
|
||||
function M.find_root(modname)
|
||||
local Cache = require("lazy.core.cache")
|
||||
local rtp = vim.deepcopy(Cache.get_rtp())
|
||||
vim.list_extend(rtp, M.get_unloaded_rtp(modname))
|
||||
local modpath = Cache.find(modname, { rtp = rtp, patterns = { "", ".lua" } })
|
||||
local modpath = Cache.find(modname, {
|
||||
rtp = true,
|
||||
paths = M.get_unloaded_rtp(modname),
|
||||
patterns = { "", ".lua" },
|
||||
})
|
||||
if modpath then
|
||||
local root = modpath:gsub("/init%.lua$", ""):gsub("%.lua$", "")
|
||||
return root
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue