Search code examples
vimsparc

Vim Block Comments Syntax Coloring Inconsistent


I am writing SPARC assembly code in Vim and there is sometimes a bug when vim applies syntax coloring to block comments ( /* ... */ style comments ).

For example: enter image description here

Vim seems to ignore the comment syntax coloring after line 42, although it is obviously all still within the block comment. This is irritating because it makes it more difficult for me to see my TODO tags.

Also, I noticed that sometimes when I add/delete random characters within the block the coloring is reset to what it should be.

Is there any way to resolve this bug?

Thanks!


Solution

  • From the vim Wiki:

    For the most accurate but slowest result, set the syntax synchronization method to fromstart. This can be done with an autocmd in your vimrc:

    autocmd BufEnter * :syntax sync fromstart