Code::Blocks Forums
Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: humjack on April 20, 2011, 08:31:09 pm
-
Inactive code (via General Settings->"Interpret #if,#else,#endif to grey out inactive preprocessor-code") uses the "Default" Syntax Highlighting. This makes it less obvious at first glance that it is inactive code (black for me). Considering the option says "grey out" I think this is a bug and the inactive code should be grey (or better yet, added as a syntax-highlighting option).
I am a new user and have only tried this out on the latest nightly build:
svn build rev 7075 (2011-03-31 19:53:04) gcc 4.5.2 Windows/unicode - 32 bit
-
I've noticed that sometimes the highlighting between active and inactive code works 80% of the time, the other 20% in back to front.
e.g.
#define ID_USE_EEPROM // this in a header file
source file :-
#ifdef ID_USE_EEPROM
kID = NonVolatile_read16(EEPROMADDRESS_ID_BASE); // << break point is set and hit here but code here is highlighted inactive
tID = NonVolatile_read8(EEPROMADDRESS_ID_BASE + 4); // << break point is set and hit here but code here is highlighted inactive
flgs = NonVolatile_read8(EEPROMADDRESS_ID_BASE + 8); // << break point is set and hit here but code here is highlighted inactive
crc = NonVolatile_read32(EEPROMADDRESS_ID_BASE + 12); // << break point is set and hit here but code here is highlighted inactive
#else
kID = IDContainer.kitID; //this code appears active but it is NOT because I have #define ID_USE_EEPROM in a header file
tID = IDContainer.txID; //this code appears active but it is NOT because I have #define ID_USE_EEPROM in a header file
flgs = IDContainer.flags; //this code appears active but it is NOT because I have #define ID_USE_EEPROM in a header file
crc = IDContainer.crc; //this code appears active but it is NOT because I have #define ID_USE_EEPROM in a header file
#endif
svn build rev 8549
-
Inactive code (via General Settings->"Interpret #if,#else,#endif to grey out inactive preprocessor-code") uses the "Default" Syntax Highlighting. This makes it less obvious at first glance that it is inactive code (black for me). Considering the option says "grey out" I think this is a bug and the inactive code should be grey (or better yet, added as a syntax-highlighting option).
I am a new user and have only tried this out on the latest nightly build:
I agree this is a bug. The settings allows the default background to change for inactive code,
but all the other types which say inactive with background "default" do NOT in fact follow the changed default.
How do I know I changed the default inactive?
Because it says "default (inactive)" but it doesnt apply as the default anywhere.
-
The #if preprocessor active/inactive is my application is right maybe 10% of the time and wrong the rest.
Is there a way to say refresh yourself and update the active/inactive state?
Why does it ignore defines in the project in other files, with the
Interpret #if, #else ... checked
Collect defines from project file checked