mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-06-28 11:24:14 +00:00
improved readability of option by removing extra passthrough items
This commit is contained in:
parent
2c9473ada5
commit
20061c3d06
2 changed files with 10 additions and 11 deletions
|
@ -438,14 +438,14 @@ return {
|
||||||
},
|
},
|
||||||
-- for niche situations where you need to inject earlier in the load cycle
|
-- for niche situations where you need to inject earlier in the load cycle
|
||||||
-- such as adding things that must be sourced before VIMRUNTIME
|
-- such as adding things that must be sourced before VIMRUNTIME
|
||||||
---@type fun(DEFAULT: string[], ME: string, VIMRUNTIME: string, NVIM_LIB: string): string[]
|
---@type fun(DEFAULT: string[], ME: string): string[]
|
||||||
override_base_rtp = function(DEFAULT, ME, VIMRUNTIME, NVIM_LIB) return DEFAULT end
|
override_base_rtp = function(DEFAULT, ME) return DEFAULT end
|
||||||
-- DEFAULT = {
|
-- DEFAULT = {
|
||||||
-- vim.fn.stdpath("config"),
|
-- vim.fn.stdpath("config"),
|
||||||
-- vim.fn.stdpath("data") .. "/site",
|
-- vim.fn.stdpath("data") .. "/site",
|
||||||
-- ME,
|
-- ME,
|
||||||
-- VIMRUNTIME,
|
-- vim.env.VIMRUNTIME,
|
||||||
-- NVIM_LIB,
|
-- vim.fn.fnamemodify(vim.v.progpath, ":p:h:h") .. "/lib/nvim",
|
||||||
-- vim.fn.stdpath("config") .. "/after",
|
-- vim.fn.stdpath("config") .. "/after",
|
||||||
-- }
|
-- }
|
||||||
},
|
},
|
||||||
|
|
|
@ -148,14 +148,14 @@ M.defaults = {
|
||||||
},
|
},
|
||||||
-- for niche situations where you need to inject earlier in the load cycle
|
-- for niche situations where you need to inject earlier in the load cycle
|
||||||
-- such as adding things that must be sourced before VIMRUNTIME
|
-- such as adding things that must be sourced before VIMRUNTIME
|
||||||
---@type fun(DEFAULT: string[], ME: string, VIMRUNTIME: string, NVIM_LIB: string): string[]
|
---@type fun(DEFAULT: string[], ME: string): string[]
|
||||||
override_base_rtp = function(DEFAULT, ME, VIMRUNTIME, NVIM_LIB) return DEFAULT end
|
override_base_rtp = function(DEFAULT, ME) return DEFAULT end
|
||||||
-- DEFAULT = {
|
-- DEFAULT = {
|
||||||
-- vim.fn.stdpath("config"),
|
-- vim.fn.stdpath("config"),
|
||||||
-- vim.fn.stdpath("data") .. "/site",
|
-- vim.fn.stdpath("data") .. "/site",
|
||||||
-- ME,
|
-- ME,
|
||||||
-- VIMRUNTIME,
|
-- vim.env.VIMRUNTIME,
|
||||||
-- NVIM_LIB,
|
-- vim.fn.fnamemodify(vim.v.progpath, ":p:h:h") .. "/lib/nvim",
|
||||||
-- vim.fn.stdpath("config") .. "/after",
|
-- vim.fn.stdpath("config") .. "/after",
|
||||||
-- }
|
-- }
|
||||||
},
|
},
|
||||||
|
@ -238,16 +238,15 @@ function M.setup(opts)
|
||||||
M.me = debug.getinfo(1, "S").source:sub(2)
|
M.me = debug.getinfo(1, "S").source:sub(2)
|
||||||
M.me = Util.norm(vim.fn.fnamemodify(M.me, ":p:h:h:h:h"))
|
M.me = Util.norm(vim.fn.fnamemodify(M.me, ":p:h:h:h:h"))
|
||||||
if M.options.performance.rtp.reset then
|
if M.options.performance.rtp.reset then
|
||||||
local NVIM_LIB = vim.fn.fnamemodify(vim.v.progpath, ":p:h:h") .. "/lib/nvim"
|
|
||||||
local base_rtp = {
|
local base_rtp = {
|
||||||
vim.fn.stdpath("config"),
|
vim.fn.stdpath("config"),
|
||||||
vim.fn.stdpath("data") .. "/site",
|
vim.fn.stdpath("data") .. "/site",
|
||||||
M.me,
|
M.me,
|
||||||
vim.env.VIMRUNTIME,
|
vim.env.VIMRUNTIME,
|
||||||
NVIM_LIB,
|
vim.fn.fnamemodify(vim.v.progpath, ":p:h:h") .. "/lib/nvim",
|
||||||
vim.fn.stdpath("config") .. "/after",
|
vim.fn.stdpath("config") .. "/after",
|
||||||
}
|
}
|
||||||
vim.opt.rtp = M.options.performance.rtp.override_base_rtp(base_rtp, M.me, vim.env.VIMRUNTIME, NVIM_LIB)
|
vim.opt.rtp = M.options.performance.rtp.override_base_rtp(base_rtp, M.me)
|
||||||
end
|
end
|
||||||
for _, path in ipairs(M.options.performance.rtp.paths) do
|
for _, path in ipairs(M.options.performance.rtp.paths) do
|
||||||
vim.opt.rtp:append(path)
|
vim.opt.rtp:append(path)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue