vim-jp / vim-cpp

c or cpp syntax files
147 stars 44 forks source link

C++ syntax highlighting misses include directives with space after the octothorpe. #49

Open ghost opened 7 years ago

ghost commented 7 years ago

In some C/C++ sources it is customary to indent lines containing directives like so:

#ifdef POSIX /* A comment. */
#    ifdef LINUX
#        define FOO(a, b) \
#            do { bar(a), baz(a##b); } while (0);
#    endif
#endif

It seems like the rule being used involves highlighting everything past "#" and then applying the rules for detecting comments. Also related is #41.

My apologies for not including this in #44, I only remembered it now and that already has a proposed fix.

ghost commented 7 years ago

I think it is also notable that the following is valid:

# /**/ ifdef POSIX
#endif