Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Different background color for inactive code

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
martin Posted - Sep 25 2009 : 10:21:58 AM
Hey, I've a lot of #ifdef/#else/#endif statements in my code and would like to have inactive code colored normally but with a different background color.
Something like http://www.xcomserver.de/VAXsugg.JPG
5   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Oct 01 2009 : 08:55:06 AM
martin how are you marking your inactive code? Is it simply wrapped in #if 0, #endif, or does it require a more complex method to work out if it is inactive?

In general VA is unable to work out if a given block of code is active or inactive, since it depends on so many things. Is the code being compiled in debug or release mode? Other environment variables, project settings, etc.
sean Posted - Sep 25 2009 : 11:31:29 AM
He wants normal VA symbol coloring with a special background color.
feline Posted - Sep 25 2009 : 11:21:31 AM
If this checkbox / feature is turned on then the IDE makes the inactive code grey, which is quite obvious, so you can see at a glance which code the IDE thinks is inactive.

Are you saying this never turns code grey for you? What about:

#if 0
// some code
#endif

martin Posted - Sep 25 2009 : 10:56:11 AM
Well, it's just a check box which disables graying out inactive code. But then I have no more hints which code is active or inactive. It would be nice if nothing but the background color would change for inactive code.
feline Posted - Sep 25 2009 : 10:50:13 AM
Depending on the IDE you are using, something like this may already exist. Look for the option:

IDE tools menu -> Options -> Text Editor -> C/C++ -> Formatting -> Colorize inactive code blocks in a different color

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000