Skip to content

Commit abd0a4f

Browse files
committed
make cssDefinition region modification slightly less hackish
1 parent a513ae7 commit abd0a4f

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

after/syntax/css.vim

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,14 +153,16 @@ endfunction
153153

154154
if has("gui_running") || &t_Co==256
155155
" HACK modify cssDefinition to add @cssColors to its contains
156-
redir => s:olddef
157-
silent! syn list cssDefinition
156+
redir => cssdef
157+
silent! syn list cssDefinition
158158
redir END
159-
if s:olddef != ''
160-
let s:b = strridx(s:olddef,'matchgroup')
161-
if s:b != -1
162-
exe 'syn region cssDefinition' strpart(s:olddef,s:b).',@cssColors'
163-
endif
159+
if len( cssdef )
160+
for out in split( cssdef, "\n" )
161+
if out !~ '^cssDefinition ' | continue | endif
162+
let out = substitute( out, ' \+xxx \+', ' ', '' )
163+
let out = substitute( out, ' contains=\zs', '@cssColors,', '' )
164+
exe 'syn region' out
165+
endfor
164166
endif
165167

166168
" w3c Colors

0 commit comments

Comments
 (0)