vim-cpp icon indicating copy to clipboard operation
vim-cpp copied to clipboard

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

Open ghost opened this issue 8 years ago • 1 comments

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 avatar May 14 '17 21:05 ghost

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

# /**/ ifdef POSIX
#endif

ghost avatar May 17 '17 15:05 ghost