Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for Neovim's icm=split #98

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions autoload/css_color.vim
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,13 @@ endfunction

function! s:create_matches()
call s:clear_matches()
if ! &l:cursorline | return | endif

" WARNING! Do not make it be one-liner by using '|' separator, it causes this bug:
" https://github.com/ap/vim-css-color/issues/95
if ! &l:cursorline
return
endif

" adds matches based that duplicate the highlighted colors on the current line
let lnr = line('.')
let group = ''
Expand Down Expand Up @@ -231,7 +237,12 @@ function! css_color#reinit()
endfunction

function! css_color#enable()
if len( b:css_color_grp ) | exe 'syn cluster colorableGroup add=' . join( b:css_color_grp, ',' ) | endif
" WARNING! Do not make it be one-liner by using '|' separator, it causes this bug:
" https://github.com/ap/vim-css-color/issues/95
if len( b:css_color_grp )
exe 'syn cluster colorableGroup add=' . join( b:css_color_grp, ',' )
endif

autocmd CSSColor CursorMoved,CursorMovedI <buffer> call s:parse_screen() | call s:create_matches()
let b:css_color_off = 0
call s:parse_screen()
Expand Down