From 64986b857df14c75d31f62b91c57554a4e8bf797 Mon Sep 17 00:00:00 2001 From: mvllow Date: Mon, 14 Feb 2022 15:20:28 -0600 Subject: [PATCH] fix user options not being applied closes #69 --- lua/rose-pine/init.lua | 7 ++++--- lua/rose-pine/palette.lua | 5 +++-- lua/rose-pine/theme.lua | 16 ++++++++-------- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/lua/rose-pine/init.lua b/lua/rose-pine/init.lua index 4e10311..3aee931 100644 --- a/lua/rose-pine/init.lua +++ b/lua/rose-pine/init.lua @@ -167,13 +167,14 @@ function M.colorscheme() ---@param color string local function get_palette_color(color) + color = color:lower() local p = require('rose-pine.palette') - if color and not color:find('#') then - return p[color:lower()] + if color and not color:find('#') and color ~= 'none' then + return p[color] end - return color:lower() + return color end ---@param group string diff --git a/lua/rose-pine/palette.lua b/lua/rose-pine/palette.lua index ccb8b1c..03981f4 100644 --- a/lua/rose-pine/palette.lua +++ b/lua/rose-pine/palette.lua @@ -16,6 +16,7 @@ local variants = { highlight_med = '#403d52', highlight_high = '#524f67', opacity = 0.1, + none = 'NONE', }, moon = { base = '#232136', @@ -34,6 +35,7 @@ local variants = { highlight_med = '#44415a', highlight_high = '#56526e', opacity = 0.1, + none = 'NONE', }, dawn = { base = '#faf4ed', @@ -52,6 +54,7 @@ local variants = { highlight_med = '#dfdad9', highlight_high = '#cecacd', opacity = 0.05, + none = 'NONE', }, } @@ -63,6 +66,4 @@ else palette = variants[(vim.g.rose_pine_variant == 'moon' and 'moon') or 'main'] end -vim.tbl_deep_extend('force', palette, { none = 'NONE' }) - return palette diff --git a/lua/rose-pine/theme.lua b/lua/rose-pine/theme.lua index 35b256a..d34c95b 100644 --- a/lua/rose-pine/theme.lua +++ b/lua/rose-pine/theme.lua @@ -8,12 +8,12 @@ function M.get(config) local theme = {} local groups = config.groups or {} local styles = { - italic = (config.disable_italics and 'NONE') or 'italic', - vert_split = (config.bold_vert_split and p.surface) or p.none, + italic = (config.disable_italics and p.none) or 'italic', + vert_split = (config.bold_vert_split and groups.border) or p.none, background = (config.disable_background and p.none) or p.base, float_background = (config.disable_float_background and p.none) or p.surface, - nc_background = (config.dim_nc_background and p.surface) or p.base, } + styles.nc_background = (config.dim_nc_background and p.surface) or styles.background theme = { ColorColumn = { bg = p.highlight_high }, @@ -65,15 +65,15 @@ function M.get(config) SpellLocal = { sp = p.subtle, style = 'undercurl' }, SpellRare = { sp = p.subtle, style = 'undercurl' }, SignColumn = { fg = p.text, bg = styles.background }, - StatusLine = { fg = p.subtle, bg = p.surface }, - StatusLineNC = { fg = p.muted, bg = p.base }, + StatusLine = { fg = p.subtle, bg = styles.float_background }, + StatusLineNC = { fg = p.muted, bg = styles.background }, StatusLineTerm = { link = 'StatusLine' }, StatusLineTermNC = { link = 'StatusLineNC' }, - TabLine = { fg = p.subtle, bg = p.surface }, - TabLineFill = { bg = p.surface }, + TabLine = { fg = p.subtle, bg = styles.float_background }, + TabLineFill = { bg = styles.float_background }, TabLineSel = { fg = p.text, bg = p.overlay }, Title = { fg = p.text }, - VertSplit = { fg = p.overlay, bg = styles.vert_split }, + VertSplit = { fg = groups.border, bg = styles.vert_split }, Visual = { bg = p.highlight_med }, -- VisualNOS = {}, WarningMsg = { fg = p.gold },