octol / vim-cpp-enhanced-highlight

Additional Vim syntax highlighting for C++ (including C++11/14/17)
MIT License
1.06k stars 152 forks source link

Misleading highlighting in #define with parenthesized expressions #92

Open distobs opened 2 years ago

distobs commented 2 years ago

In:

#define exp ((1 + 5) / 7.04f)

exp is highlighted as if it were a function, which is not true.

Expected behavior: differentiate #defines from actual function definitions, and highlight or not #defines if there is or isn't whitespace before the parentheses:

define printint(x) printf("%d\n", x)

define pexp (7.0f + 2.4f)

Highlight printint, but not pexp