fix(extras): make sure we use priorities to import extras in correct order
This commit is contained in:
1 parent
3256abda65
commit
a4e393154f
2 files changed
+18
-14
No files matched your search
@@ -1,5 +1,22 @@
|
|||||||
local Config = require("lazyvim.config")
|
local Config = require("lazyvim.config")
|
||||||
|
|
||||||
|
-- Some extras need to be loaded before others
|
||||||
|
local prios = {
|
||||||
|
["editor.aerial"] = 100,
|
||||||
|
["editor.symbols-outline"] = 100,
|
||||||
|
["test.core"] = 1,
|
||||||
|
["dap.core"] = 1,
|
||||||
|
}
|
||||||
|
|
||||||
|
table.sort(Config.json.data.extras, function(a, b)
|
||||||
|
local pa = prios[a] or 10
|
||||||
|
local pb = prios[b] or 10
|
||||||
|
if pa == pb then
|
||||||
|
return a < b
|
||||||
|
end
|
||||||
|
return pa < pb
|
||||||
|
end)
|
||||||
|
|
||||||
---@param extra string
|
---@param extra string
|
||||||
return vim.tbl_map(function(extra)
|
return vim.tbl_map(function(extra)
|
||||||
return { import = "lazyvim.plugins.extras." .. extra }
|
return { import = "lazyvim.plugins.extras." .. extra }
|
||||||
|
|||||||
@@ -16,12 +16,6 @@ local Util = require("lazyvim.util")
|
|||||||
---@class lazyvim.util.extras
|
---@class lazyvim.util.extras
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
M.prios = {
|
|
||||||
["editor.aerial"] = 100,
|
|
||||||
["test.core"] = 1,
|
|
||||||
["dap.core"] = 1,
|
|
||||||
}
|
|
||||||
|
|
||||||
M.ns = vim.api.nvim_create_namespace("lazyvim.extras")
|
M.ns = vim.api.nvim_create_namespace("lazyvim.extras")
|
||||||
---@type string[]
|
---@type string[]
|
||||||
M.state = nil
|
M.state = nil
|
||||||
@@ -115,14 +109,7 @@ function X:toggle()
|
|||||||
table.insert(Config.json.data.extras, extra.name)
|
table.insert(Config.json.data.extras, extra.name)
|
||||||
M.state[#M.state + 1] = "lazyvim.plugins.extras." .. extra.name
|
M.state[#M.state + 1] = "lazyvim.plugins.extras." .. extra.name
|
||||||
end
|
end
|
||||||
table.sort(Config.json.data.extras, function(a, b)
|
table.sort(Config.json.data.extras)
|
||||||
local pa = M.prios[a] or 10
|
|
||||||
local pb = M.prios[b] or 10
|
|
||||||
if pa == pb then
|
|
||||||
return a < b
|
|
||||||
end
|
|
||||||
return pa < pb
|
|
||||||
end)
|
|
||||||
Config.json.save()
|
Config.json.save()
|
||||||
Util.info(
|
Util.info(
|
||||||
"`"
|
"`"
|
||||||
|
|||||||
Reference in new issue
Block a user