From b9c6ca6b2e25f16b1d996de83bbc4acc7b0d1aa0 Mon Sep 17 00:00:00 2001 From: Pocco81 Date: Thu, 2 Sep 2021 11:40:23 -0500 Subject: [PATCH] fix #24: Error when enabling term colors --- lua/catppuccino/core/mapper.lua | 1 + lua/catppuccino/utils/util.lua | 38 ++++++++++++++++----------------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/lua/catppuccino/core/mapper.lua b/lua/catppuccino/core/mapper.lua index 1a2fd5e..e5c7fe7 100644 --- a/lua/catppuccino/core/mapper.lua +++ b/lua/catppuccino/core/mapper.lua @@ -219,6 +219,7 @@ function M.apply(cs) set_cs(color_scheme) local theme = {} + theme.colors = get_cs() theme.base = get_base() theme.integrations = get_integrations() theme.properties = get_properties() diff --git a/lua/catppuccino/utils/util.lua b/lua/catppuccino/utils/util.lua index d86b3f2..e6d1746 100644 --- a/lua/catppuccino/utils/util.lua +++ b/lua/catppuccino/utils/util.lua @@ -114,24 +114,24 @@ function util.properties(tbl) end end -function util.terminal(theme) - g.terminal_color_0 = theme.colors.black - g.terminal_color_1 = theme.colors.red - g.terminal_color_2 = theme.colors.green - g.terminal_color_3 = theme.colors.yellow - g.terminal_color_4 = theme.colors.blue - g.terminal_color_5 = theme.colors.magenta - g.terminal_color_6 = theme.colors.cyan - g.terminal_color_7 = theme.colors.white - - g.terminal_color_8 = theme.colors.black_br - g.terminal_color_9 = theme.colors.red_br - g.terminal_color_10 = theme.colors.green_br - g.terminal_color_11 = theme.colors.yellow_br - g.terminal_color_12 = theme.colors.blue_br - g.terminal_color_13 = theme.colors.magenta_br - g.terminal_color_14 = theme.colors.cyan_br - g.terminal_color_15 = theme.colors.white_br +function util.terminal(clrs) + g.terminal_color_0 = clrs.black + g.terminal_color_1 = clrs.red + g.terminal_color_2 = clrs.green + g.terminal_color_3 = clrs.yellow + g.terminal_color_4 = clrs.blue + g.terminal_color_5 = clrs.magenta + g.terminal_color_6 = clrs.cyan + g.terminal_color_7 = clrs.white + + g.terminal_color_8 = clrs.black_br + g.terminal_color_9 = clrs.red_br + g.terminal_color_10 = clrs.green_br + g.terminal_color_11 = clrs.yellow_br + g.terminal_color_12 = clrs.blue_br + g.terminal_color_13 = clrs.magenta_br + g.terminal_color_14 = clrs.cyan_br + g.terminal_color_15 = clrs.white_br end function util.load(theme) @@ -147,7 +147,7 @@ function util.load(theme) util.syntax(theme.integrations) if require("catppuccino.config").options["term_colors"] then - util.terminal(theme) + util.terminal(theme.colors) end end