Skip to content

Commit

Permalink
refactor: renamed Config.opt => Config.defaults.opt
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Nov 30, 2022
1 parent 5d81c50 commit 334f32e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion lua/lazy/core/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
Expand Down
6 changes: 3 additions & 3 deletions lua/lazy/core/plugin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 334f32e

Please sign in to comment.