Permalink
Browse files

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.
  • Loading branch information...
1 parent 0ebc1eb commit b3656708cb0cb35ac01bc1f57172a2fa98ac427e @jhogendorn jhogendorn committed Dec 22, 2010
Showing with 5 additions and 14 deletions.
  1. +5 −14 autoload/indent_guides.vim
View
@@ -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
"

0 comments on commit b365670

Please sign in to comment.