From 046104c2f06fa6dbce8a75740631a96a340c468f Mon Sep 17 00:00:00 2001 From: Nate Kane Date: Wed, 29 Dec 2010 20:17:34 +1000 Subject: [PATCH] Tweaked the indent_guides#cterm_highlight_colors() function a bit --- autoload/indent_guides.vim | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/autoload/indent_guides.vim b/autoload/indent_guides.vim index 5ab2cd1..fd16662 100644 --- a/autoload/indent_guides.vim +++ b/autoload/indent_guides.vim @@ -87,17 +87,17 @@ function! indent_guides#highlight_colors() endfunction " -" Automagically calculates and defines the indent highlight colors for -" terminal vim. +" Defines the indent highlight colors for terminal vim. +" +" NOTE: This function contains no magic at the moment, it will simply use some +" light or dark preset colors depending on the `set background=` value. " function! indent_guides#cterm_highlight_colors() - if &g:background == 'dark' - exe 'hi IndentGuidesEven ctermbg=darkgrey' - exe 'hi IndentGuidesOdd ctermbg=black' - else - exe 'hi IndentGuidesEven ctermbg=lightgrey' - exe 'hi IndentGuidesOdd ctermbg=white' - endif + let l:colors = (&g:background == 'dark') ? + \ ['darkgrey', 'black'] : ['lightgrey', 'white'] + + exe 'hi IndentGuidesEven ctermbg=' . l:colors[0] + exe 'hi IndentGuidesOdd ctermbg=' . l:colors[1] endfunction "