Skip to content

Commit 8a84356

Browse files
committed
skip cursorline emulation on NeoVim >= 0.3.1
NeoVim commit 12481781a0215c2ba0ab250d9cfdb9a082ab495a changes the priority of the CursorLine highlight group in most cases, obviating the need for the potentially expensive cursorline support workaround in this plugin. Thanks to @bryclee for alerting me to this. This closes #112.
1 parent afd659b commit 8a84356

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

autoload/css_color.vim

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,13 @@ function! css_color#enable()
235235
if len( b:css_color_grp ) | exe 'syn cluster colorableGroup add=' . join( b:css_color_grp, ',' ) | endif
236236
augroup CSSColor
237237
autocmd! * <buffer>
238-
autocmd CursorMoved,CursorMovedI <buffer> call s:parse_screen() | call s:create_matches()
239-
autocmd BufWinEnter <buffer> call s:create_matches()
240-
autocmd BufWinLeave <buffer> call s:clear_matches()
238+
if has('nvim-0.3.1')
239+
autocmd CursorMoved,CursorMovedI <buffer> call s:parse_screen()
240+
else
241+
autocmd CursorMoved,CursorMovedI <buffer> call s:parse_screen() | call s:create_matches()
242+
autocmd BufWinEnter <buffer> call s:create_matches()
243+
autocmd BufWinLeave <buffer> call s:clear_matches()
244+
endif
241245
autocmd ColorScheme <buffer> call css_color#reinit()
242246
augroup END
243247
let b:css_color_off = 0

0 commit comments

Comments
 (0)