scss-syntax.vim icon indicating copy to clipboard operation
scss-syntax.vim copied to clipboard

Very slow for files over 1000 lines

Open moll opened this issue 7 years ago • 2 comments

Hey!

Thanks for taking the time to write VimL!

However, is it me or is the SCSS syntax highlighting particularly slow for long files? Or in that sense, slow for any file, but particularly noticeable for larger files. Switching back and from the highlighted buffer ends up taking half a second...

moll avatar Jun 02 '17 20:06 moll

Oh, I didn't remember I reported this 5 years ago. Anyways, I've tracked this down to the https://github.com/cakebaker/scss-syntax.vim/blob/master/ftdetect/scss.vim#L2 line:

au BufEnter *.scss :syntax sync fromstart

Given a long file, this causes quite the delay when entering the buffer, and seems unnecessary as well.

moll avatar Jun 14 '22 14:06 moll

Thanks for your comment.

I don't think the command is unnecessary. Without it, I get highlighting errors from time to time. What you could try in your .vimrc is to either clear the sync settings with:

au BufEnter *.scss :syntax sync clear

or to use minlines instead of fromstart:

au BufEnter *.scss :syntax sync minlines=100

Hope that helps.

cakebaker avatar Jun 16 '22 08:06 cakebaker