Author Topic: Specific highlighting  (Read 2068 times)

Offline Phumus-9

  • Multiple posting newcomer
  • *
  • Posts: 12
Specific highlighting
« on: February 12, 2019, 09:17:36 pm »
Hello everyone,
I recently started programming in C++ and I decided to use Codeblocks as my IDE, and the first thing I'd like to change is the highlighting, because the default one is too colorful.
I was wondering if there was a way to highlight of a specific color the fields of a class (inside that class). For example:

Code
class Rectangle {
    int width, height;
  public:
    int area() {return width*height;}
};

I'd like to have every occurrence of "width" and "height" highlighted of a specific style. I searched on the forum but I found nothing, probably it's not a requested feature.


Moreover I'd like to highlight constants and the names of classes (about this last thing I found a question dated 2011, and the answer was that it was not possible, but maybe things have changed).

Last thing regarding highlighting: what is the "global classes and typedefs" option for?

Thanks in advance!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13161
    • Travis build status
Re: Specific highlighting
« Reply #1 on: February 13, 2019, 12:32:56 am »
I guess the answer is nope to this request. C::B doesn't support semantic highlight. It has a hack which sort of works on members, but it is not reliable.

BTW. You're saying that the highlighting looks colorful, but still want to have semantic highlighting which turns code into a rainbow :)
(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 Phumus-9

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Specific highlighting
« Reply #2 on: February 13, 2019, 03:25:10 pm »
I guess the answer is nope to this request. C::B doesn't support semantic highlight. It has a hack which sort of works on members, but it is not reliable.

BTW. You're saying that the highlighting looks colorful, but still want to have semantic highlighting which turns code into a rainbow :)

Thanks for the answer!
Well, I come from IntellijIDEA, that is why I'd like to have that type of highlighting. You are right, I like semantic highlighting, but more than a rainbow of colours it is a rainbow of styles (underlined, bold, ...). Colors are just black, dark blue and dark purple ;D. But for example I hate those red operators, and I don't know why every IDE highlights operators, but generally only in C/C++.

You talked about an hack, do you have a link where I can elaborate on this?

Moreover I noticed that the text I write in C::B is not sharp. I don't know how to explain, but it is kind of blurred. I use the default font.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13161
    • Travis build status
Re: Specific highlighting
« Reply #3 on: February 13, 2019, 07:58:16 pm »
You talked about an hack, do you have a link where I can elaborate on this?
I think it is on by default, but is somewhere in the editor settings.

Moreover I noticed that the text I write in C::B is not sharp. I don't know how to explain, but it is kind of blurred. I use the default font.
OS, Monitor DPI, scaling setting, C::B version? If you're on windows you have to tell codeblocks that it is dpiaware or something similar. Or try a night build.
(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 Phumus-9

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Specific highlighting
« Reply #4 on: February 14, 2019, 02:20:13 pm »
Moreover I noticed that the text I write in C::B is not sharp. I don't know how to explain, but it is kind of blurred. I use the default font.
OS, Monitor DPI, scaling setting, C::B version? If you're on windows you have to tell codeblocks that it is dpiaware or something similar. Or try a night build.

Windows 10, the screen is 17' and full HD (1920x1080), scaling setting in Windows settings menu is 125%, C::B 17.12.
I right clicked on C::B icon -> Properties -> Compatibility. There I enabled "Disable full screen optimization". Then in the same menu I clicked "Modify high DPI settings" and there I enabled the first opion and selected "Use DPI values at the opening of this program". Then I applied these new settings, opened the program but nothing changed.


You talked about an hack, do you have a link where I can elaborate on this?
I think it is on by default, but is somewhere in the editor settings.
Mhh, I snooped a bit in Settings -> Editor, but I found nothing.

Thanks again!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13161
    • Travis build status
Re: Specific highlighting
« Reply #5 on: February 15, 2019, 08:28:51 am »
There was a topic how to change the dpi awareness somewhere on the forum.

About the setting Settings -> Editor -> Code completion -> Disable pseudo semantic keyword highlighting
(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 Phumus-9

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Specific highlighting
« Reply #6 on: February 15, 2019, 01:34:43 pm »
There was a topic how to change the dpi awareness somewhere on the forum.

About the setting Settings -> Editor -> Code completion -> Disable pseudo semantic keyword highlighting

Ok, thank you very much!
By the way, as you told me, pseudo semantic highlighting is on by default, but members variables are plain black. I chacked all of the 9 groups of keywords.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13161
    • Travis build status
Re: Specific highlighting
« Reply #7 on: February 15, 2019, 06:35:44 pm »
What is the color for the "Global classes and typedefs" style in the C++ syntax highlight 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!]

Offline Phumus-9

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Specific highlighting
« Reply #8 on: February 16, 2019, 06:50:20 pm »
What is the color for the "Global classes and typedefs" style in the C++ syntax highlight settings?
Fuchsia

Offline Phumus-9

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Specific highlighting
« Reply #9 on: February 16, 2019, 08:09:46 pm »
By the way, as you told me, pseudo semantic highlighting is on by default, but members variables are plain black. I chacked all of the 9 groups of keywords.
Ok don't worry, I'm actually distracted these days... I noticed that if I enable that checkbox, it disables the semantic higlighting... I unchecked it and now it works fine (by the way it does not highlight user defined types, and if a variable in a method has the same name as a class field it will highlight it, but as you told me it is a basic tool).
Thank you a lot for your time oBFusCATed!
« Last Edit: February 16, 2019, 08:18:31 pm by Phumus-9 »