From 3439f8c5a518f6b914865f52f32776cd96284fae Mon Sep 17 00:00:00 2001 From: amfl Date: Sat, 21 Feb 2015 22:38:32 +1300 Subject: [PATCH 1/2] Added an option `g:gruvbox_foreground_guisp` to have guisp color override foreground color --- colors/gruvbox.vim | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/colors/gruvbox.vim b/colors/gruvbox.vim index 602edbec..f38ae122 100644 --- a/colors/gruvbox.vim +++ b/colors/gruvbox.vim @@ -41,6 +41,9 @@ endif if !exists('g:gruvbox_underline') let g:gruvbox_underline=1 endif +if !exists('g:gruvbox_foreground_guisp') + let g:gruvbox_foreground_guisp=0 +endif if !exists('g:gruvbox_italicize_comments') let g:gruvbox_italicize_comments=1 @@ -228,7 +231,11 @@ function! s:HL(group, fg, ...) let histring = 'hi ' . a:group . ' ' - if strlen(a:fg) + " if (Foreground override enabled) && ( We were passed a guisp value ) + if g:gruvbox_foreground_guisp != 0 && a:0 >= 3 && strlen(a:3) && a:3 != 'none' + let c = get(s:gb, a:3) + let histring .= 'guifg=#' . c[0] . ' ctermfg=' . c[1] . ' ' + elseif strlen(a:fg) if a:fg == 'fg' let histring .= 'guifg=fg ctermfg=fg ' elseif a:fg == 'bg' From 577ef4a65a4d77db0f98add3a36deb27406f0400 Mon Sep 17 00:00:00 2001 From: amfl Date: Wed, 17 Jun 2015 20:09:06 +1200 Subject: [PATCH 2/2] Changed to g:gruvbox_guisp_fallback, which takes 'fg' or 'bg' as an argument --- colors/gruvbox.vim | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/colors/gruvbox.vim b/colors/gruvbox.vim index f38ae122..a7151d5c 100644 --- a/colors/gruvbox.vim +++ b/colors/gruvbox.vim @@ -41,8 +41,8 @@ endif if !exists('g:gruvbox_underline') let g:gruvbox_underline=1 endif -if !exists('g:gruvbox_foreground_guisp') - let g:gruvbox_foreground_guisp=0 +if !exists('g:gruvbox_guisp_fallback') || index(['fg', 'bg'], g:gruvbox_guisp_fallback) == -1 + let g:gruvbox_guisp_fallback='none' endif if !exists('g:gruvbox_italicize_comments') @@ -232,7 +232,7 @@ function! s:HL(group, fg, ...) let histring = 'hi ' . a:group . ' ' " if (Foreground override enabled) && ( We were passed a guisp value ) - if g:gruvbox_foreground_guisp != 0 && a:0 >= 3 && strlen(a:3) && a:3 != 'none' + if g:gruvbox_guisp_fallback == 'fg' && a:0 >= 3 && strlen(a:3) && a:3 != 'none' let c = get(s:gb, a:3) let histring .= 'guifg=#' . c[0] . ' ctermfg=' . c[1] . ' ' elseif strlen(a:fg) @@ -248,7 +248,11 @@ function! s:HL(group, fg, ...) endif endif - if a:0 >= 1 && strlen(a:1) + " if (Background override enabled) && ( We were passed a guisp value ) + if g:gruvbox_guisp_fallback == 'bg' && a:0 >= 3 && strlen(a:3) && a:3 != 'none' + let c = get(s:gb, a:3) + let histring .= 'guibg=#' . c[0] . ' ctermbg=' . c[1] . ' ' + elseif a:0 >= 1 && strlen(a:1) if a:1 == 'bg' let histring .= 'guibg=bg ctermbg=bg ' elseif a:fg == 'fg'