fix(pack): load plugin configs in declared order

This commit is contained in:
2026-05-07 03:03:01 +02:00
parent e9d13627c8
commit 25db26b3e3
+6 -1
View File
@@ -266,8 +266,10 @@ end
---@param specs (string | ow.Pack.Spec)[]
function M.setup(specs)
local pack_specs = {}
local order = {}
for _, spec in ipairs(specs) do
local src = type(spec) == "string" and spec or spec.src
table.insert(order, src)
if is_url(src) then
table.insert(pack_specs, to_pack_spec(spec))
else
@@ -302,7 +304,9 @@ function M.setup(specs)
vim.cmd.packadd(plugin.name)
end)
for _, plugin in pairs(M.plugins) do
for _, src in ipairs(order) do
local plugin = M.plugins[src]
if plugin then
if plugin.build then
local data = changed[plugin.src]
if data then
@@ -312,6 +316,7 @@ function M.setup(specs)
end
load(plugin.name, false)
end
end
vim.api.nvim_create_autocmd("PackChanged", {
group = vim.api.nvim_create_augroup(