From c7dded5ab27642e84143f6c75dc50155a10ae5ee Mon Sep 17 00:00:00 2001 From: mvllow Date: Sat, 5 Feb 2022 13:10:01 -0600 Subject: [PATCH] fix nil groups --- lua/rose-pine/init.lua | 17 ++++++++--------- lua/rose-pine/theme.lua | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/lua/rose-pine/init.lua b/lua/rose-pine/init.lua index 748edce..8525305 100644 --- a/lua/rose-pine/init.lua +++ b/lua/rose-pine/init.lua @@ -91,15 +91,14 @@ function M.setup(opts) }, } - local groups = opts.groups or {} - if type(groups.headings) == 'string' then - groups.headings = { - h1 = groups.headings, - h2 = groups.headings, - h3 = groups.headings, - h4 = groups.headings, - h5 = groups.headings, - h6 = groups.headings, + if opts.groups and type(opts.groups.headings) == 'string' then + opts.groups.headings = { + h1 = opts.groups.headings, + h2 = opts.groups.headings, + h3 = opts.groups.headings, + h4 = opts.groups.headings, + h5 = opts.groups.headings, + h6 = opts.groups.headings, } end diff --git a/lua/rose-pine/theme.lua b/lua/rose-pine/theme.lua index 1bd38a4..4a5429c 100644 --- a/lua/rose-pine/theme.lua +++ b/lua/rose-pine/theme.lua @@ -5,7 +5,7 @@ local M = {} function M.get(config) local theme = {} - local groups = config.groups + local groups = config.groups or {} local colors = palette[config.variant or 'main'] local styles = { italic = (config.disable_italics and 'italic') or 'NONE',