Has anyone else noticed that "bool" is colored in .h files and not colored in .c files? Is there any plan in the works to fix that?
While we're at it, can the editor options be extended so user-defined types can be colored? Not necessarily the same color as built-in types, but not the same as ordinary text, either.
Hi Jim,
I'm moving this to the CCS forum so they can see your feature suggestion.
Regards,
Katie
Please click the Verify Answer button on this post if it answers your question.
Jim,
The use of bool in a C file is considered a macro reference by the highlighter. Coloring of macro references is not enabled by default but you can turn it on. If you go to Window -> Preferences. Type coloring in the top left filter box. Syntax Coloring under Editor should now be selected and you will see the options on the right.
John
If my reply answers your question please mark the thread as answered
John,
Thanx!
Now that I've done as you said, it looks as it should.
That still doesn't explain why bool is bold and maroon in the header file and black and plain in the code file the defaults are active.
JimT
Curiouser and curiouser!
I turned on coloring for macro references to get bool to look as it should, and it worked as described. However, I didn't like all the other macros showing up in color, so I switched back to black. When I looked at my code again, behold! Not only was the coloring in the .c file gone, as I expected, but the coloring in the .h file had disappeared also.
Is a puzzlement!
In playing with the header file it seems to treat bool as a built-in type there. I just created a blank one and put bool in it and it shows it in bold purple. I changed built in types to not be bold and it changed it. Not sure why it is a built-in type for headers.
I can't replicate what you are seeing though with it disappearing from the headers. Did you change it back to black or uncheck the box to enable highlighting for that class of element? For me I uncheck the box and the coloring goes away for the C file but stays for the H file.
You're right. I hadn't unchecked it. Now it works as it did originally.
Just for fun I went back and looked at a couple of old projects in CCS v4. In v4 bool, true, and false are always red, either in code or headers. In v5 they are always red in headers, always black in code.