User forums > Using Code::Blocks
syntax highlighting question
EricKane:
rev2369
why syntax highlighting setting always change after I set option then restart CB.
as same as i save layout and after delete layout , what use does it have?
How could i keep my syntax highlighting setting when i update to new revision?
Max:
It's a known bug. You will observe "color settings lost" when you change the editor settings .
There are two bug reports open, 7063 and 7194. They are related to the same issue ( I think).
Pecan wrote a patch (990) for this issue, but the developpers didn't apply it. May be it is not the
right solution or there are more important task to be completed.
Wait for a new version in which this issue has been fixed, or apply the patch by yourself. :D
Bye
Massimo
Pecan:
--- Quote ---Quote from: Pecan on April 11, 2006, 12:10:55 PM
It seems that in default.conf, only the current changes are being recorded.
Here's a proposed fix for this problem. It seems editorcolorset.cpp::save() was deleting the previous user settings
before writing the new user setting.
I'll submit a bug patch to berlios.
--- Code: ---
Index: src/sdk/editorcolorset.cpp
===================================================================
--- src/sdk/editorcolorset.cpp (revision 2337)
+++ src/sdk/editorcolorset.cpp (working copy)
@@ -466,7 +466,8 @@
{
wxString key;
ConfigManager* cfg = Manager::Get()->GetConfigManager(_T("editor"));
- cfg->DeleteSubPath(_T("/color_sets/") + m_Name);
+ // The next stmt causes all previous user settings to be deleted //pecan 2006/4/11
+ //-cfg->DeleteSubPath(_T("/color_sets/") + m_Name); //pecan 2006/4/11
// write the theme name
cfg->Write(_T("/color_sets/") + m_Name + _T("/name"), m_Name);
--- End code ---
thanks
pecan
--- End quote ---
Patch is 990
thomas:
That patch fixes the symptom, but I am not sure if simply commenting out that line alltogether it is 100% the right thing yet.
The deletion of the subpath was introduced way back because otherwise you would not be able to ever delete an item added to a set. Something seems to go wrong though.
Without having looked at it closer, my guess is that DeleteSubPath should be moved into the loop and should be done once for each language, not for the whole big thing... will try and see.
thomas:
After trying for a while, I've applied the patch for now, lacking a better solution (rev. 2376).
I know for sure that Yiannis explicitely asked for a DeleteSubPath() function because it would not work without it in some cases. Unluckily, I don't remember what it was... :S
However, for the time being, commenting out that line certainly makes things better. With settings lost every time, the app is quite unusuable. Let's see if it fails, and why :)
We might replace that wx container with std::map some day in the future, then we could read and write the complete colour settings using one SDK call, without iterating through elements, deleting subpaths, and all that tampering. Haven't got time for that conversion now, though.
Navigation
[0] Message Index
[#] Next page
Go to full version