mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-18 20:36:45 +00:00
refactor(cache): refactor for upstreaming to vim.loader
This commit is contained in:
parent
e27c9df5fe
commit
6b55862d2d
4 changed files with 144 additions and 97 deletions
|
@ -241,13 +241,13 @@ function M.get_unloaded_rtp(modname)
|
|||
end
|
||||
|
||||
function M.find_root(modname)
|
||||
local modpath = require("lazy.core.cache").find(modname, {
|
||||
local ret = require("lazy.core.cache").find(modname, {
|
||||
rtp = true,
|
||||
paths = M.get_unloaded_rtp(modname),
|
||||
patterns = { "", ".lua" },
|
||||
})
|
||||
if modpath then
|
||||
local root = modpath:gsub("/init%.lua$", ""):gsub("%.lua$", "")
|
||||
})[1]
|
||||
if ret then
|
||||
local root = ret.modpath:gsub("/init%.lua$", ""):gsub("%.lua$", "")
|
||||
return root
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue