diff --git a/after/syntax/css/vim-coloresque.vim b/after/syntax/css/vim-coloresque.vim index acb58f4..d7f6f62 100644 --- a/after/syntax/css/vim-coloresque.vim +++ b/after/syntax/css/vim-coloresque.vim @@ -51,11 +51,11 @@ function! s:MatchColorValue(color, part) let b:color_pattern[a:part] = a:color endif - if !exists('b:matchescache') - let b:matchescache = {} - elseif !exists('b:matchescache[a:part]') - let b:matchescache[a:part] = matchadd(group, a:part, -1) - endif + if !exists('b:matchescache') + let b:matchescache = {} + elseif !exists('b:matchescache[a:part]') + let b:matchescache[a:part] = matchadd(group, '\w\@\|#[0-9A-Fa-f]\{6\}\>', - \ 'rgba' : 'rgba\?(\s*\(\d\{1,3}%\?\)\s*,\s*\(\d\{1,3}%\?\)\s*,\s*\(\d\{1,3}%\?\)\s*\%(,[^)]*\)\?)', - \ 'hsla' : 'hsla\?(\s*\(\d\{1,3}%\?\)\s*,\s*\(\d\{1,3}%\?\)\s*,\s*\(\d\{1,3}%\?\)\s*\%(,[^)]*\)\?)' - \ } + "if !exists('&w:colorDictRegExp') + "endif + + let line=a:str "getline(a:w) + let colorexps = { + \ 'hex' : '\w\@\|#[0-9A-Fa-f]\{6\}\>', + \ 'rgba' : '\w\@ silent call s:VimCssInit(1) autocmd BufEnter silent call s:VimCssInit(1) augroup END -endif \ No newline at end of file +endif