refactor: renamed Config.opt => Config.defaults.opt

This commit is contained in:
Folke Lemaitre 2022-11-30 23:08:40 +01:00
parent 5d81c5062b
commit 334f32e595
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
2 changed files with 7 additions and 4 deletions

View File

@ -4,8 +4,11 @@ local M = {}
---@class LazyConfig
M.defaults = {
opt = true,
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 = {
path = vim.fn.expand("~/projects"), -- the path where you store your projects
---@type string[]

View File

@ -160,14 +160,14 @@ function M.update_state()
for _, plugin in pairs(Config.plugins) do
plugin._ = plugin._ or {}
if plugin.opt == nil then
plugin.opt = plugin.dep
or Config.options.opt
local opt = plugin.dep
or Config.options.defaults.opt
or plugin.module
or plugin.event
or plugin.keys
or plugin.ft
or plugin.cmd
plugin.opt = plugin.opt and true or false
plugin.opt = opt and true or false
end
local opt = plugin.opt and "opt" or "start"
plugin.dir = Config.options.packpath .. "/" .. opt .. "/" .. plugin.name