Permalink
Browse files

fix highlight bug, discarded too much in 3010741

  • Loading branch information...
1 parent 5ffe3b7 commit 8a3200425befe0e3307ae6a1cbc8b89601b85494 @ap committed Apr 21, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 after/syntax/css.vim
View
8 after/syntax/css.vim
@@ -28,10 +28,16 @@ let s:fg_color_calc = 'let color = "#" . toupper(a:color)'
function! s:MatchColorValue(color, pattern)
if ! len(a:color) | return | endif
+
if has_key( b:color_pattern, a:pattern ) | return | endif
let b:color_pattern[a:pattern] = 1
+
+ let pattern = a:pattern
+ " iff pattern ends on word character, require word break to match
+ if pattern =~ '\>$' | let pattern .= '\>' | endif
+
let group = 'cssColor' . tolower(a:color)
- exe 'syn match' group '/'.a:pattern.'\>/ contained'
+ exe 'syn match' group '/'.pattern.'/ contained'
exe 'syn cluster cssColors add='.group
exe s:fg_color_calc
exe 'hi' group s:color_prefix.'bg='.color s:color_prefix.'fg='.s:FGForBG(a:color)

0 comments on commit 8a32004

Please sign in to comment.