arakashic / chromatica.nvim

Clang based syntax highlighting for Neovim
MIT License
299 stars 17 forks source link

Coloring switches off when OpenMP pragma is used #76

Open piotrklos-tcl opened 5 years ago

piotrklos-tcl commented 5 years ago

It is a common thing in C++ and C to parallelize code by stucking an openmp pragma in front of a for loop like so:

#pragma omp parallel for
for(int i=0; i < size; ++i)
{
    (...)
}

The problem is that the syntax highlighting is switched off after the pragma (the loop becomes white text on black background in my nvim). The rest of the file is colored normally, only the loop is white-on-black.

I expect it to be colored normally.

Please, note that openmp pragmas have purely additive nature, i.e. if I remove the pragma, the code will compile and give the same result. Hence, it's overly conservative to switch off the coloring after those.