Menu

#771 Preprocessor highlighting of code does not follow includes

Undefined
open
nobody
None
Bug_Report
2018-12-08
2018-12-08
Walt
No

Greying out code based on preprocessor conditions seems to only work if the preprocessor elements are defined in the same file as the condition.

Menu Settings->Editor...->General settings->C/C++ Editor settings
Enable "Interpret #if, #elseif, #endif to grey out inactive preprocessor-code".

Add preprocessor define to test.h header file:

#define MYDEF 1

Include header and add preprocess conditional code to test.cpp file:

#include "test.h"

#if MYDEF
int n;
#endif

Expected behaviour: "int n;" displays normally.
Actual behaviour: "int n;" is greyed out.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.