feat: improved dealing with vim.o.background

This commit is contained in:
Folke Lemaitre
2022-09-10 09:35:41 +02:00
parent 54cf70dbd1
commit 6244df26b5
8 changed files with 47 additions and 30 deletions

View File

@@ -32,6 +32,7 @@ local defaults = {
---@param highlights Highlights
---@param colors ColorScheme
on_highlights = function(highlights, colors) end,
use_background = true, -- can be light/dark/auto. When auto, background will be set to vim.o.background
}
---@type Config
@@ -47,6 +48,10 @@ function M.extend(options)
M.options = vim.tbl_deep_extend("force", {}, M.options or defaults, options or {})
end
function M.is_day()
return M.options.style == "day" or M.options.use_background and vim.o.background == "light"
end
M.setup()
return M