Refactored heaps of stuff and added autocmds

This commit is contained in:
Nate Kane
2010-12-09 22:45:09 +10:00
parent 51d44e3ebf
commit 5e91b15edc
3 changed files with 68 additions and 48 deletions

View File

@@ -1,16 +1,6 @@
" Author: Nate Kane <nathanaelkane AT gmail DOT com>
" Homepage: http://github.com/nathanaelkane/vim-indent-guides
"
" Regex pattern for a hex color.
"
" Example matches:
" - '#123ABC'
" - '#ffffff'
" - '#000000'
"
let s:hex_color_pattern = '#[0-9A-Fa-f]\{6\}'
"
" Return hex string equivalent to given decimal string or number.
"
@@ -49,7 +39,7 @@ endfunction
function! color_helper#hex_color_to_rgb(hex_color)
let l:rgb = []
if matchstr(a:hex_color, s:hex_color_pattern) == a:hex_color
if a:hex_color =~ g:indent_guides_hex_color_pattern
let l:red = color_helper#hex_to_dec(strpart(a:hex_color, 1, 2))
let l:green = color_helper#hex_to_dec(strpart(a:hex_color, 3, 2))
let l:blue = color_helper#hex_to_dec(strpart(a:hex_color, 5, 2))