fix(pack): load plugin configs in declared order
This commit is contained in:
+6
-1
@@ -266,8 +266,10 @@ end
|
|||||||
---@param specs (string | ow.Pack.Spec)[]
|
---@param specs (string | ow.Pack.Spec)[]
|
||||||
function M.setup(specs)
|
function M.setup(specs)
|
||||||
local pack_specs = {}
|
local pack_specs = {}
|
||||||
|
local order = {}
|
||||||
for _, spec in ipairs(specs) do
|
for _, spec in ipairs(specs) do
|
||||||
local src = type(spec) == "string" and spec or spec.src
|
local src = type(spec) == "string" and spec or spec.src
|
||||||
|
table.insert(order, src)
|
||||||
if is_url(src) then
|
if is_url(src) then
|
||||||
table.insert(pack_specs, to_pack_spec(spec))
|
table.insert(pack_specs, to_pack_spec(spec))
|
||||||
else
|
else
|
||||||
@@ -302,7 +304,9 @@ function M.setup(specs)
|
|||||||
vim.cmd.packadd(plugin.name)
|
vim.cmd.packadd(plugin.name)
|
||||||
end)
|
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
|
if plugin.build then
|
||||||
local data = changed[plugin.src]
|
local data = changed[plugin.src]
|
||||||
if data then
|
if data then
|
||||||
@@ -312,6 +316,7 @@ function M.setup(specs)
|
|||||||
end
|
end
|
||||||
load(plugin.name, false)
|
load(plugin.name, false)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("PackChanged", {
|
vim.api.nvim_create_autocmd("PackChanged", {
|
||||||
group = vim.api.nvim_create_augroup(
|
group = vim.api.nvim_create_augroup(
|
||||||
|
|||||||
Reference in New Issue
Block a user