Fixed the common idiom of setting a plugin to true. (#1152)
This commit is contained in:
parent
437b954595
commit
dd6eee1542
|
@ -56,8 +56,9 @@ config.plugins = {}
|
||||||
-- Allow you to set plugin configs even if we haven't seen the plugin before.
|
-- Allow you to set plugin configs even if we haven't seen the plugin before.
|
||||||
setmetatable(config.plugins, {
|
setmetatable(config.plugins, {
|
||||||
__index = function(t, k)
|
__index = function(t, k)
|
||||||
if rawget(t, k) == nil then rawset(t, k, {}) end
|
local v = rawget(t, k)
|
||||||
return rawget(t, k)
|
if v == true or v == nil then v = {} rawset(t, k, v) end
|
||||||
|
return v
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue