Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Vim's Haskell syntax highlighting broken?

It seems to me that Vim's syntax highlighting for Haskell is broken, or very buggy. Multiline comments in Haskell (beginning with {- and ending with -}) are arbitrarily greened-out and un-greened-out. Sometimes dragging the mouse over the commented code causes it to reverse color.

Has anyone else been experiencing this problem?

like image 302
xkdkxdxc Avatar asked Feb 06 '10 01:02

xkdkxdxc


1 Answers

Vim's syntax highlighting trades off accuracy for performance, by default. To do this, it only examines a certain number of lines before the current position to determine how things should be highlighted. This means that it can sometimes get out of sync.

The different methods it uses to determine how much text to examine can be seen at :help :syn-sync. If you want it to Just Work, use :syn sync fromstart to make Vim consider the entire buffer up to the cursor to determine the highlighting.

like image 95
jamessan Avatar answered Sep 20 '22 21:09

jamessan