Author Topic: Editor colors ... file?  (Read 7237 times)

RX

  • Guest
Editor colors ... file?
« on: July 23, 2007, 06:35:18 pm »
Hello ... i have spent a lot of time in editing the colors for the editor in CB.

Now i want so send this "color theme" to my friend via internet ... witch file must i send to my friend so that he can unse my colortheme?

Does anybody know where to find new colorthemes for CB?

sorry for the bad english ... ^^

peace

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Editor colors ... file?
« Reply #1 on: July 23, 2007, 08:05:02 pm »
There is no support for exchanging discrete editor colour sets between different copies of Code::Blocks.

Editor colour sets are either derived from the lexter files (which can be shared, and which work as default settings for your Code::Blocks installation) or are stored inside the configuration file. You can of course copy the entire configuration file, which will also copy the editor colours.

You might possibly be lucky using the cb_share_config tool that Morten wrote, but this is unsupported (and I'm not sure if it can do that, I've never tried it).
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Editor colors ... file?
« Reply #2 on: July 23, 2007, 09:50:58 pm »
but this is unsupported (and I'm not sure if it can do that, I've never tried it).
a) it's not unsupported - ask me to add additional features
b) no, it can't share coloursets as of now. Implementing this would be easy though.
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Editor colors ... file?
« Reply #3 on: July 23, 2007, 09:53:37 pm »
I'm sorry to say that whoever wrote the color editing tool in C::B did users a disservice. Instead of simply creating a local copy of the the lexer file in the users codeblocks settings folder and updating the lexer file for the users changes, the color editing tool maintains color changes in the users C::B configuration file (e.g. in default.conf for the default personality). The positive is you can have a different color set for different personalities, but this is a mixed blessing if you want your custom color sets to apply to all of your personalities. Consequently, it is unnecessarily complicated to copy colour settings.

Until Morten comes up with the fix, the only way to "export" them is to manually copy the relevant sections of default.conf (it is a flat text xml file located in \documents and settings\youraccount\application data\codeblocks) to your friends default.conf file. Look for the tag pair <colour_sets> </colour_sets> and copy that into the <editor> </editor> section of your friends .conf file (if his .conf file contains <colour_sets> you will should delete it). There is obviously no guarantee this will work perfectly, so make sure to back up your friends old .conf file

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Editor colors ... file?
« Reply #4 on: July 23, 2007, 09:58:38 pm »
b) no, it can't share coloursets as of now. Implementing this would be easy though.

would it be possible to enumerate the entire configuration file as a tree so people can export arbitrary bits of it? (there may be some parts of the file that would be dangerous to export, but they could be specifically excluded)

I would also like to see specification of colour_set customization in conf files replaced with modifiable local copies of the lexer file (the could be given personality prefixes such as default-lexer-cpp etc). Is anyone else in favor?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Editor colors ... file?
« Reply #5 on: July 23, 2007, 10:09:12 pm »
would it be possible to enumerate the entire configuration file as a tree so people can export arbitrary bits of it?
No, cb_share_config was designed to only copy mature parts that most likely will not result in errors if done so.

For what you want keep in mind that the config file is XML - any good XML sync tool can handle what you want.

With regards, Morten.

Ps.: For the colour_set bit... I'll see what I can do... ;-)
Edit: See r4301... -> Oh, we crossed 4300! *woot*
« Last Edit: July 23, 2007, 10:28:14 pm by MortenMacFly »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Editor colors ... file?
« Reply #6 on: July 24, 2007, 02:22:15 am »
a) it's not unsupported - ask me to add additional features
It is unsupported. The only supported thing that's allowed to modify config files is Code::Blocks.

Anything else is hacking, and unsupported, even if it works. If anything goes wrong, it's the user's problem alone. The same is true for editing the XML in a text editor. While this is certainly possible and will probably work just fine 99.9% of the time (yes, I've been doing it myself), it is not supported.

Regarding making a copy of the lexer files, this is certainly a possible approach. To me, either is the same, since I have never had the need to change a colour set, but I could imagine that there are as many people who prefer having just one file to copy for everything. To be honest, I have no idea which is "better", if any solution can be said better at all.
For now, I wouldn't touch colour sets, since it is not dearly necessary and whether or not one favours the present system, at least it works reliably.
The risk of "improving" something that works reliably to a point where it doesn't work any more *cough* *cough* is unfavourable if we ever plan to bring out a release. There are still enough things to fix that don't work, unluckily.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Editor colors ... file?
« Reply #7 on: July 24, 2007, 02:38:54 am »
Regarding making a copy of the lexer files, this is certainly a possible approach. To me, either is the same, since I have never had the need to change a colour set, but I could imagine that there are as many people who prefer having just one file to copy for everything. To be honest, I have no idea which is "better", if any solution can be said better at all.

with "mature" editors such as vim and emacs, people regularly exchange color sets. I would rather download someone's carefully thought out syntax highlighting than do the painstaking work myself. with that in mind, keeping the style info in separate files would be much easier to manage.

Quote
For now, I wouldn't touch colour sets, since it is not dearly necessary and whether or not one favours the present system, at least it works reliably.

agree. another thing to add to the post 1.0 list.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Editor colors ... file?
« Reply #8 on: July 24, 2007, 07:46:39 am »
a) it's not unsupported - ask me to add additional features
It is unsupported. The only supported thing that's allowed to modify config files is Code::Blocks.
Well I thought using the very same API (the one of C::B itself) made it "supported". If you say that's not true it's unsupported then - I don't mind. Whatever you say, sir, I'll follow. I'm a Lemming. :lol:
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ