mirror of https://github.com/folke/lazy.nvim.git
refactor: renamed Config.opt => Config.defaults.opt
This commit is contained in:
parent
5d81c5062b
commit
334f32e595
|
@ -4,8 +4,11 @@ local M = {}
|
||||||
|
|
||||||
---@class LazyConfig
|
---@class LazyConfig
|
||||||
M.defaults = {
|
M.defaults = {
|
||||||
opt = true,
|
|
||||||
plugins = "config.plugins",
|
plugins = "config.plugins",
|
||||||
|
defaults = {
|
||||||
|
opt = false, -- should plugins default to "opt" or "start"
|
||||||
|
-- version = "*", -- enable this to try installing the latest stable versions of plugins
|
||||||
|
},
|
||||||
dev = {
|
dev = {
|
||||||
path = vim.fn.expand("~/projects"), -- the path where you store your projects
|
path = vim.fn.expand("~/projects"), -- the path where you store your projects
|
||||||
---@type string[]
|
---@type string[]
|
||||||
|
|
|
@ -160,14 +160,14 @@ function M.update_state()
|
||||||
for _, plugin in pairs(Config.plugins) do
|
for _, plugin in pairs(Config.plugins) do
|
||||||
plugin._ = plugin._ or {}
|
plugin._ = plugin._ or {}
|
||||||
if plugin.opt == nil then
|
if plugin.opt == nil then
|
||||||
plugin.opt = plugin.dep
|
local opt = plugin.dep
|
||||||
or Config.options.opt
|
or Config.options.defaults.opt
|
||||||
or plugin.module
|
or plugin.module
|
||||||
or plugin.event
|
or plugin.event
|
||||||
or plugin.keys
|
or plugin.keys
|
||||||
or plugin.ft
|
or plugin.ft
|
||||||
or plugin.cmd
|
or plugin.cmd
|
||||||
plugin.opt = plugin.opt and true or false
|
plugin.opt = opt and true or false
|
||||||
end
|
end
|
||||||
local opt = plugin.opt and "opt" or "start"
|
local opt = plugin.opt and "opt" or "start"
|
||||||
plugin.dir = Config.options.packpath .. "/" .. opt .. "/" .. plugin.name
|
plugin.dir = Config.options.packpath .. "/" .. opt .. "/" .. plugin.name
|
||||||
|
|
Loading…
Reference in New Issue