Author Topic: Why is NULL not highlighted?  (Read 2730 times)

Offline konjina

  • Multiple posting newcomer
  • *
  • Posts: 18
Why is NULL not highlighted?
« 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?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Why is NULL not highlighted?
« Reply #1 on: March 31, 2018, 10:53:45 am »
It is not a keyword, it is a macro.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline konjina

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: Why is NULL not highlighted?
« Reply #2 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.

Offline gd_on

  • Lives here!
  • ****
  • Posts: 796
Re: Why is NULL not highlighted?
« Reply #3 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
Windows 11 64 bits (23H2), svn C::B (last version or almost!), wxWidgets 3.2.4 (tests with 3.3), Msys2 Compilers 13.2.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Why is NULL not highlighted?
« Reply #4 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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]