Permalink
Browse files

Tweaked the indent_guides#cterm_highlight_colors() function a bit

  • Loading branch information...
1 parent 9b43f5c commit 046104c2f06fa6dbce8a75740631a96a340c468f @nathanaelkane committed Dec 29, 2010
Showing with 9 additions and 9 deletions.
  1. +9 −9 autoload/indent_guides.vim
View
@@ -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
"

0 comments on commit 046104c

Please sign in to comment.