Skip to content

Commit 9bb9b79

Browse files
committed
fix ap#95 ap#95
1 parent 2221178 commit 9bb9b79

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

autoload/css_color.vim

+13-2
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,13 @@ endfunction
184184

185185
function! s:create_matches()
186186
call s:clear_matches()
187-
if ! &l:cursorline | return | endif
187+
188+
" WARNING! Do not make it be one-liner by using '|' separator, it causes this bug:
189+
" https://github.com/ap/vim-css-color/issues/95
190+
if ! &l:cursorline
191+
return
192+
endif
193+
188194
" adds matches based that duplicate the highlighted colors on the current line
189195
let lnr = line('.')
190196
let group = ''
@@ -231,7 +237,12 @@ function! css_color#reinit()
231237
endfunction
232238

233239
function! css_color#enable()
234-
if len( b:css_color_grp ) | exe 'syn cluster colorableGroup add=' . join( b:css_color_grp, ',' ) | endif
240+
" WARNING! Do not make it be one-liner by using '|' separator, it causes this bug:
241+
" https://github.com/ap/vim-css-color/issues/95
242+
if len( b:css_color_grp )
243+
exe 'syn cluster colorableGroup add=' . join( b:css_color_grp, ',' )
244+
endif
245+
235246
autocmd CSSColor CursorMoved,CursorMovedI <buffer> call s:parse_screen() | call s:create_matches()
236247
let b:css_color_off = 0
237248
call s:parse_screen()

0 commit comments

Comments
 (0)