nested & NONE colors override added (#84)
This commit is contained in:
@@ -245,18 +245,23 @@ end
|
|||||||
function util.color_overrides(colors, config)
|
function util.color_overrides(colors, config)
|
||||||
if type(config.colors) == "table" then
|
if type(config.colors) == "table" then
|
||||||
for key, value in pairs(config.colors) do
|
for key, value in pairs(config.colors) do
|
||||||
if not colors[key] then
|
if not colors[key] then error("Color " .. key .. " does not exist") end
|
||||||
error("Color " .. key .. " does not exist")
|
|
||||||
end
|
-- Patch: https://github.com/ful1e5/onedark.nvim/issues/6
|
||||||
if string.sub(value, 1, 1) == "#" then
|
if type(colors[key]) == "table" then
|
||||||
-- hex override
|
util.color_overrides(colors[key], { colors = value })
|
||||||
colors[key] = value
|
|
||||||
else
|
else
|
||||||
-- another group
|
if value:lower() == "none" then
|
||||||
if not colors[value] then
|
-- set to none
|
||||||
error("Color " .. value .. " does not exist")
|
colors[key] = "NONE"
|
||||||
|
elseif string.sub(value, 1, 1) == "#" then
|
||||||
|
-- hex override
|
||||||
|
colors[key] = value
|
||||||
|
else
|
||||||
|
-- another group
|
||||||
|
if not colors[value] then error("Color " .. value .. " does not exist") end
|
||||||
|
colors[key] = colors[value]
|
||||||
end
|
end
|
||||||
colors[key] = colors[value]
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user