Code::Blocks

User forums => Using Code::Blocks => Topic started by: konjina on March 31, 2018, 03:21:39 am

Title: Why is NULL not highlighted?
Post by: konjina on March 31, 2018, 03:21:39 am
Basically what's in the title.

Is there a particular reason for this keyword not to be highlighted?
Title: Re: Why is NULL not highlighted?
Post by: oBFusCATed on March 31, 2018, 10:53:45 am
It is not a keyword, it is a macro.
Title: Re: Why is NULL not highlighted?
Post by: konjina on April 02, 2018, 09:44:09 am
It is not a keyword, it is a macro.

My bad, sorry.

In any case, I think it should be highlighted. Every other IDE/Text editor does it. It's quite useful to have stand out.
Title: Re: Why is NULL not highlighted?
Post by: gd_on on April 02, 2018, 11:03:26 am
if NULL is used for a pointer, you can replace it by nullptr, which is highligthed.

gd_on
Title: Re: Why is NULL not highlighted?
Post by: oBFusCATed on April 02, 2018, 04:04:41 pm
In any case, I think it should be highlighted. Every other IDE/Text editor does it. It's quite useful to have stand out.
You can always add it to your list of keywords in the syntax highlight settings for c/c++ lexer in the Editor settings.