Compare commits

...

4 Commits

Author SHA1 Message Date
HC 161b68d8e3
Merge 2dd4c46ecd into 460e1cd8f2 2024-09-16 11:38:39 +03:00
github-actions[bot] 460e1cd8f2 chore(build): auto-generate rockspec mappings 2024-09-16 08:17:41 +00:00
Folke Lemaitre aca30f6361
fix(bootstrap): single forward slash. Fixes #1747 2024-09-16 10:13:11 +02:00
abcdefg233 2dd4c46ecd feat(ui): always load plugins in order of priority 2024-07-23 16:19:09 +08:00
3 changed files with 391 additions and 342 deletions

View File

@ -1,4 +1,4 @@
-- Lay Bootstrapper -- Lazy Bootstrapper
-- Usage: -- Usage:
-- ```lua -- ```lua
-- load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))() -- load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()
@ -7,7 +7,7 @@ local M = {}
function M.setup() function M.setup()
if vim.env.LAZY_STDPATH then if vim.env.LAZY_STDPATH then
local root = vim.fn.fnamemodify(vim.env.LAZY_STDPATH, ":p") local root = vim.fn.fnamemodify(vim.env.LAZY_STDPATH, ":p"):gsub("[\\/]$", "")
for _, name in ipairs({ "config", "data", "state", "cache" }) do for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end end

File diff suppressed because it is too large Load Diff

View File

@ -181,21 +181,30 @@ function M.load(plugins, reason, opts)
---@diagnostic disable-next-line: cast-local-type ---@diagnostic disable-next-line: cast-local-type
plugins = (type(plugins) == "string" or plugins.name) and { plugins } or plugins plugins = (type(plugins) == "string" or plugins.name) and { plugins } or plugins
---@cast plugins (string|LazyPlugin)[] ---@cast plugins (string|LazyPlugin)[]
local queue = {}
for _, plugin in pairs(plugins) do for _, plugin in pairs(plugins) do
if type(plugin) == "string" then if type(plugin) == "string" then
if Config.plugins[plugin] then if Config.plugins[plugin] then
plugin = Config.plugins[plugin] plugin = Config.plugins[plugin]
elseif Config.spec.disabled[plugin] then elseif Config.spec.disabled[plugin] then
plugin = nil goto continue
else else
Util.error("Plugin " .. plugin .. " not found") Util.error("Plugin " .. plugin .. " not found")
plugin = nil goto continue
end end
end end
if plugin and not plugin._.loaded then if not plugin._.loaded then
M._load(plugin, reason, opts) table.insert(queue, plugin)
end end
::continue::
end
table.sort(queue,function (a,b)
return a.priority and b.priority and a.priority>b.priority
end)
for _,plugin in ipairs(queue) do
M._load(plugin, reason, opts)
end end
end end