From bfca2548ef699ae7c32ced931aa7cc0f9039ec70 Mon Sep 17 00:00:00 2001 From: Eivind Uggedal Date: Tue, 20 Apr 2021 18:15:48 +0200 Subject: fix hard/soft contrast with light background Light overrides was also overriding hard/soft bg --- lua/gruvbox/base.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lua') diff --git a/lua/gruvbox/base.lua b/lua/gruvbox/base.lua index 1e587e4..d4d396e 100644 --- a/lua/gruvbox/base.lua +++ b/lua/gruvbox/base.lua @@ -26,20 +26,12 @@ local aqua = colors.bright_aqua local orange = colors.bright_orange local gray = colors.gray --- handle light/dark contrast settings local bg = vim.o.background if bg == nil then bg = "dark" vim.o.background = bg end -local contrast = vim.g["gruvbox_contrast_" .. bg] -if contrast == "hard" then - bg0 = colors[bg .. "0_hard"] -elseif contrast == "soft" then - bg0 = colors[bg .. "0_soft"] -end - -- swap colors if light mode if bg == "light" then bg0 = colors.light0 @@ -61,6 +53,14 @@ if bg == "light" then orange = colors.faded_orange end +-- handle light/dark contrast settings +local contrast = vim.g["gruvbox_contrast_" .. bg] +if contrast == "hard" then + bg0 = colors[bg .. "0_hard"] +elseif contrast == "soft" then + bg0 = colors[bg .. "0_soft"] +end + -- extending colors table with basic names for easy customization in g:gruvbox_* options colors.bg0 = bg0 colors.bg1 = bg1 -- cgit v1.2.3