From b3656708cb0cb35ac01bc1f57172a2fa98ac427e Mon Sep 17 00:00:00 2001 From: Joshua Hogendorn Date: Wed, 22 Dec 2010 10:31:06 +1000 Subject: [PATCH] Terminal colours are now based on the Normal BG Instead of using the foreground and background of a search result, which is usually designed to stand right out, the indents for terminal are now colored according to the normal text background. --- autoload/indent_guides.vim | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/autoload/indent_guides.vim b/autoload/indent_guides.vim index b993cc7..3ec756c 100644 --- a/autoload/indent_guides.vim +++ b/autoload/indent_guides.vim @@ -91,23 +91,14 @@ endfunction " terminal vim. " function! indent_guides#cterm_highlight_colors() - let hi_search = indent_guides#capture_highlight('Search') - let ctermfg_pattern = "ctermfg=\\zs[0-9A-Za-z]\\+\\ze" - let ctermbg_pattern = "ctermbg=\\zs[0-9A-Za-z]\\+\\ze" - let hi_search_ctermfg = '' + let hi_search = indent_guides#capture_highlight('Normal') + let ctermbg_pattern = "ctermbg=\\zs[0-9]\\+\\ze" let hi_search_ctermbg = '' - " capture the foreground color from the search highlight - if hi_search =~ ctermfg_pattern - let hi_search_ctermfg = matchstr(hi_search, ctermfg_pattern) - exe 'hi IndentGuidesOdd ctermbg=' . hi_search_ctermfg - endif - " capture the background color from the search highlight - if hi_search =~ ctermbg_pattern - let hi_search_ctermbg = matchstr(hi_search, ctermbg_pattern) - exe 'hi IndentGuidesEven ctermbg=' . hi_search_ctermbg - endif + let hi_search_ctermbg = matchstr(hi_search, ctermbg_pattern) + exe 'hi IndentGuidesEven ctermbg=' . (hi_search_ctermbg + 1) + exe 'hi IndentGuidesOdd ctermbg=' . (hi_search_ctermbg + 2) endfunction "