Added in new merge method, and run it on plugins. Also made it so plugin configs can be set anywhere, even if we don't know the plugin beforehand.
This commit is contained in:
@@ -17,6 +17,14 @@ function common.clamp(n, lo, hi)
|
||||
end
|
||||
|
||||
|
||||
function common.merge(a, b)
|
||||
local t = {}
|
||||
for k, v in pairs(a) do t[k] = v end
|
||||
if b then for k, v in pairs(b) do t[k] = v end end
|
||||
return t
|
||||
end
|
||||
|
||||
|
||||
function common.round(n)
|
||||
return n >= 0 and math.floor(n + 0.5) or math.ceil(n - 0.5)
|
||||
end
|
||||
|
||||
@@ -30,10 +30,16 @@ config.borderless = false
|
||||
config.tab_close_button = true
|
||||
config.max_clicks = 3
|
||||
|
||||
-- Disable plugin loading setting to false the config entry
|
||||
-- of the same name.
|
||||
config.plugins = {}
|
||||
-- Allow you to set plugin configs even if we haven't seen the plugin before.
|
||||
setmetatable(config.plugins, {
|
||||
__index = function(t, k)
|
||||
if rawget(t, k) == nil then rawset(t, k, {}) end
|
||||
return rawget(t, k)
|
||||
end
|
||||
})
|
||||
|
||||
-- Disable these plugins by default.
|
||||
config.plugins.trimwhitespace = false
|
||||
config.plugins.lineguide = false
|
||||
config.plugins.drawwhitespace = false
|
||||
|
||||
Reference in New Issue
Block a user