mirror of https://github.com/folke/lazy.nvim.git
Compare commits
4 Commits
59e78d0be2
...
161b68d8e3
Author | SHA1 | Date |
---|---|---|
HC | 161b68d8e3 | |
github-actions[bot] | 460e1cd8f2 | |
Folke Lemaitre | aca30f6361 | |
abcdefg233 | 2dd4c46ecd |
|
@ -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
|
@ -181,22 +181,31 @@ 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
|
||||||
|
table.insert(queue, plugin)
|
||||||
|
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)
|
M._load(plugin, reason, opts)
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
---@param plugin LazyPlugin
|
---@param plugin LazyPlugin
|
||||||
|
|
Loading…
Reference in New Issue