Skip to content

Commit aa38bbc

Browse files
committed
commit to having b:css_color_off
1 parent 6aa147b commit aa38bbc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

autoload/css_color.vim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ function! css_color#reinit()
231231
endfunction
232232

233233
function! css_color#enable()
234+
if ! b:css_color_off | return | endif
234235
if len( b:css_color_grp ) | exe 'syn cluster colorableGroup add=' . join( b:css_color_grp, ',' ) | endif
235236
autocmd CSSColor CursorMoved,CursorMovedI <buffer> call s:parse_screen() | call s:create_matches()
236237
let b:css_color_off = 0
@@ -239,13 +240,13 @@ function! css_color#enable()
239240
endfunction
240241

241242
function! css_color#disable()
243+
if b:css_color_off | return | endif
242244
if len( b:css_color_grp ) | exe 'syn cluster colorableGroup remove=' . join( b:css_color_grp, ',' ) | endif
243245
autocmd! CSSColor CursorMoved,CursorMovedI <buffer>
244246
let b:css_color_off = 1
245247
endfunction
246248

247249
function! css_color#toggle()
248-
if ! exists('b:css_color_off') | return | endif
249250
if b:css_color_off | call css_color#enable()
250251
else | call css_color#disable()
251252
endif
@@ -262,6 +263,7 @@ function! css_color#init(type, keywords, groups)
262263
let b:css_color_grp = extend( get( b:, 'css_color_grp', [] ), split( a:groups, ',' ), 0 )
263264
let b:css_color_hi = {}
264265
let b:css_color_syn = {}
266+
let b:css_color_off = 1
265267

266268
augroup CSSColor
267269
autocmd! * <buffer>

0 commit comments

Comments
 (0)