Author Topic: Syntax Highlighting doesn't take  (Read 7810 times)

Offline fiziwig

  • Single posting newcomer
  • *
  • Posts: 4
Syntax Highlighting doesn't take
« on: August 18, 2015, 08:41:57 pm »
First off, I'm very happy with Code::Blocks. I've been using it for a week now after moving from Windows to Linux/Mint.

My only problem is syntax highlighting. I searched the forum for answers but every search term I typed returned "no entries found"  :(

C/C++ syntax highlighting doesn't stick. When I change the colors manually they change in the source window for the current session only, but next time I run Code::Blocks my changes are gone.

If I create a new theme and then select that theme next time I launch, nothing changes. It remains on default color scheme.

If I download and install additional themes from the wiki, they show up in the syntax highlighting drop down menu, but when I select them nothing changes. The highlighting remains the default color scheme.

No matter what I do I only ever see default syntax highlighting. My tired old eyes have trouble with the nearly invisible comment color of the default scheme, and it's a nuisance to have to manually change the comment highlighting every time I launch the program.

I'm tempted to edit the xml in the config file for the default color scheme, but that's probably not a good idea.

Other than that, Code:Blocks is wonderful! I love it. I spent the last 15 years using MSVCC so moving from Windows to Linux and Code:Blocks was a big change, but it turned out to be a lot easier than I expected. Code::Blocks has everything I need for my C++ coding. Thank you!  :) :) :)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Syntax Highlighting doesn't take
« Reply #1 on: August 18, 2015, 10:57:31 pm »
My guess is that cb is crashing on exit and it doesn't save the settings.
My suggestion is open cb, setup your settings and close it directly without opening any projects.
(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 fiziwig

  • Single posting newcomer
  • *
  • Posts: 4
Re: Syntax Highlighting doesn't take
« Reply #2 on: August 18, 2015, 11:08:41 pm »
OK, I went ahead and tried that. No difference.
It does save the name of the theme I selected, but even when it comes up with that theme (slush n poppies) as the selected theme, it still shows all the code in default highlighting.
It also save other options like "environment > open default workspace" so it seems like settings in general are being saved.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Syntax Highlighting doesn't take
« Reply #3 on: August 18, 2015, 11:52:35 pm »
What happens you you open the default conf file and search for your theme? Is it there with the proper colours?
(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 fiziwig

  • Single posting newcomer
  • *
  • Posts: 4
Re: Syntax Highlighting doesn't take
« Reply #4 on: August 19, 2015, 02:50:15 am »
Yes, the theme is there under the correct name and with the correct colors.

I don't know if this is related, but in the debugger I adjust the width of the panes in the watch window and that doesn't stick either. Are they both saved in the same config file? On the other hand, when I select "environment > open default workspace" that does stick.

I also have a windows box. I should install cb there and try the same sequence of operations. It might be Linux specific(?).

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Syntax Highlighting doesn't take
« Reply #5 on: August 19, 2015, 08:28:52 am »
Yes, the config is the same for almost everything.

To check if cb is crashing start it from terminal. If you see something like "blabla segmentation fault blabla", then it is crashing.
(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 fiziwig

  • Single posting newcomer
  • *
  • Posts: 4
Re: Syntax Highlighting doesn't take
« Reply #6 on: August 19, 2015, 08:46:02 pm »
I tried running cb from the terminal and it looks just fine. Its starts out with:

Initialize EditColourSet .....
Initialize EditColourSet: done.
Loading menubar...

---etc---

and then on exit, ends with:

Deinitializing plugins...

There are no error messages of any kind.

I thought there might be more than one copy of default.conf floating around somewhere else in the filesystem, but "locate" didn't find any that could be connected with cb, so that's not the problem.

I think for now I'll just let it go and live with it. Thanks for all the suggestions.  :)


Offline YalithKBK

  • Single posting newcomer
  • *
  • Posts: 2
Re: Syntax Highlighting doesn't take
« Reply #7 on: February 07, 2016, 06:50:07 pm »
Created an account just to say I am having a similar issue.  Except for me, the settings are not taking at all.  When I click Settings>Editor>Syntax Highlighting I can see all of my themes there and the colors change in the example text when I select different themes.  Once I pick a theme and click "ok" my theme is never applied.

As I have terrible vision (that can't be fixed with glasses), light text on a dark background is much easier on my eyes.  I would love if someone could share some insight into why my colors are not changing.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Syntax Highlighting doesn't take
« Reply #8 on: February 07, 2016, 07:18:30 pm »
Can you post the exact steps you do? OS and C::B versions?
Most helpful it will be if you can post a video.
(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 YalithKBK

  • Single posting newcomer
  • *
  • Posts: 2
Re: Syntax Highlighting doesn't take
« Reply #9 on: February 11, 2016, 01:05:57 am »
I am using Ubuntu 14.04, Code::Blocks 16.01 and I followed the Linux steps on this website: http://tafhim.blogspot.co.uk/2010/08/exporting-and-importing-codeblocks.html

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Syntax Highlighting doesn't take
« Reply #10 on: February 11, 2016, 01:37:40 am »
Have you used sudo to launch cb_share_config?
Can you check if you have correct permissions for the default.conf file?
(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!]