Set vim.o.background to the correct value when not using 'auto'
This commit is contained in:
parent
d7ab1515c4
commit
28cae122a9
@ -51,6 +51,7 @@ local base_colors = {
|
||||
local variants = {
|
||||
dark = {
|
||||
_name = 'dark',
|
||||
background = 'dark',
|
||||
['bg'] = base_colors['flexoki-black'],
|
||||
['bg-2'] = base_colors['flexoki-950'],
|
||||
['ui'] = base_colors['flexoki-900'],
|
||||
@ -78,6 +79,7 @@ local variants = {
|
||||
},
|
||||
light = {
|
||||
_name = 'light',
|
||||
background = 'light',
|
||||
['bg'] = base_colors['flexoki-paper'],
|
||||
['bg-2'] = base_colors['flexoki-50'],
|
||||
['ui'] = base_colors['flexoki-100'],
|
||||
@ -106,15 +108,20 @@ local variants = {
|
||||
}
|
||||
|
||||
M.palette = function ()
|
||||
local variant = {}
|
||||
|
||||
if config.options.variant == 'auto' then
|
||||
if vim.o.background == 'dark' then
|
||||
return variants[config.options.dark_variant]
|
||||
variant = variants[config.options.dark_variant]
|
||||
else
|
||||
return variants[config.options.light_variant]
|
||||
variant = variants[config.options.light_variant]
|
||||
end
|
||||
else
|
||||
return variants[config.options.variant]
|
||||
variant = variants[config.options.variant]
|
||||
vim.o.background = variant.background
|
||||
end
|
||||
|
||||
return variant
|
||||
end
|
||||
|
||||
return M
|
||||
|
Loading…
Reference in New Issue
Block a user