mirror of https://github.com/folke/lazy.nvim.git
fix(spec): make sure imported specs are sorted alphabetically
This commit is contained in:
parent
e5ba443416
commit
ff76e58961
|
@ -254,7 +254,15 @@ function Spec:import(spec)
|
||||||
self.modules[#self.modules + 1] = spec.import
|
self.modules[#self.modules + 1] = spec.import
|
||||||
|
|
||||||
local imported = 0
|
local imported = 0
|
||||||
|
|
||||||
|
---@type string[]
|
||||||
|
local modnames = {}
|
||||||
Util.lsmod(spec.import, function(modname)
|
Util.lsmod(spec.import, function(modname)
|
||||||
|
modnames[#modnames + 1] = modname
|
||||||
|
end)
|
||||||
|
table.sort(modnames)
|
||||||
|
|
||||||
|
for _, modname in ipairs(modnames) do
|
||||||
imported = imported + 1
|
imported = imported + 1
|
||||||
Util.track({ import = modname })
|
Util.track({ import = modname })
|
||||||
self.importing = modname
|
self.importing = modname
|
||||||
|
@ -273,7 +281,7 @@ function Spec:import(spec)
|
||||||
Util.track()
|
Util.track()
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end)
|
end
|
||||||
if imported == 0 then
|
if imported == 0 then
|
||||||
self:error("No specs found for module " .. spec.import)
|
self:error("No specs found for module " .. spec.import)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue