mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-18 20:36:45 +00:00
perf(plugin): minor optim to resolve imports a bit faster
This commit is contained in:
parent
1fad61712b
commit
a9d7ade203
2 changed files with 13 additions and 8 deletions
|
@ -150,8 +150,11 @@ function Spec:import(spec)
|
|||
local modspecs = {}
|
||||
|
||||
if type(import) == "string" then
|
||||
Util.lsmod(import, function(modname)
|
||||
Util.lsmod(import, function(modname, modpath)
|
||||
modspecs[#modspecs + 1] = modname
|
||||
package.preload[modname] = function()
|
||||
return loadfile(modpath)()
|
||||
end
|
||||
end)
|
||||
table.sort(modspecs)
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue