use default config outside of setup function

ref #63
This commit is contained in:
mvllow 2022-02-06 21:17:35 -06:00
commit ecbd3ae709

View file

@ -41,14 +41,7 @@ local M = {}
---@field h6 string
---@type RosePineConfig
local config = {}
---@param opts RosePineConfig
function M.setup(opts)
opts = opts or {}
vim.g.rose_pine_variant = opts.variant or 'main'
local default_config = {
local config = {
variant = 'main',
bold_vert_split = false,
dim_nc_background = false,
@ -88,6 +81,11 @@ function M.setup(opts)
},
}
---@param opts RosePineConfig
function M.setup(opts)
opts = opts or {}
vim.g.rose_pine_variant = opts.variant or 'main'
if opts.groups and type(opts.groups.headings) == 'string' then
opts.groups.headings = {
h1 = opts.groups.headings,
@ -100,7 +98,7 @@ function M.setup(opts)
end
config.user_variant = opts.variant or nil
config = vim.tbl_deep_extend('force', default_config, opts)
config = vim.tbl_deep_extend('force', config, opts)
end
function M.colorscheme()