@@ -124,6 +124,10 @@ else
124
124
endfunction
125
125
endif
126
126
127
+ function ! s: recreate_highlights ()
128
+ call filter ( copy ( b: css_color_hi ), ' s:create_highlight( v:key, v:val )' )
129
+ endfunction
130
+
127
131
let s: pattern_color = {}
128
132
let s: color_bright = {}
129
133
function ! s: create_syn_match ()
@@ -223,7 +227,7 @@ endfunction
223
227
" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
224
228
225
229
function ! css_color#reinit ()
226
- call filter ( keys ( b: css_color_hi ), ' s:create_highlight( v:val, s:color_bright[v:val] ) ' )
230
+ call s: recreate_highlights ( )
227
231
call s: flush_exe ()
228
232
endfunction
229
233
@@ -278,3 +282,12 @@ function! css_color#init(type, keywords, groups)
278
282
call extend ( s: color_bright , b: css_color_hi )
279
283
endif
280
284
endfunction
285
+
286
+ " utility function for development use
287
+ function ! css_color#dump_highlights ()
288
+ call s: recreate_highlights ()
289
+ let cmd = join ( sort ( remove ( s: exe , 0 , -1 ) ), " \n " )
290
+ let cmd = substitute ( cmd, ' #......' , ' \U&' , ' g' )
291
+ let cmd = substitute ( cmd, ' ctermbg=\zs\d\+' , ' \=printf("%-3d",submatch(0))' , ' g' )
292
+ return cmd
293
+ endfunction
0 commit comments