On really long files, vim will sometimes shortcut and only look backward X number of lines for syntax highlighting.  The errors that come up are especially pronounced in the more... difficult to parse :) languages like perl.