Author Topic: Syntax Highlighting bug  (Read 5332 times)

Max

  • Guest
Syntax Highlighting bug
« on: April 07, 2006, 02:17:33 pm »
Dear all,
Using CB 2317 (Windows XP SP2) I got the following bug

Open Setting->Editor->Syntax Highlighting

Using the default color them click on "keyword" and select "Set 2" (it should be the user keyword set, isn't it?),

try to add a keyword to the list (currently I have the following list
DWORD HWND HINSTANCE
) for example add the keywod HANDLE.


Click OK and OK again to close the setting window.


The bug is: The modification is lost. No new keyword are really added.


My default.conf has

<editor>
   <keywords>
        <SET1>
      <str>DWORD HWND HINSTANCE</str>
        </SET1>
   </keywords>
   </editor>


manually modifying it to

<editor>
   <keywords>
        <SET1>
      <str>DWORD HWND HINSTANCE HANDLE</str>
        </SET1>
   </keywords>
   </editor>

seems to work.


I am correctly using the right procedure to add a new user keyword?

Regards

Massimo


Max

  • Guest
Re: Syntax Highlighting bug (more..)
« Reply #1 on: April 07, 2006, 06:07:17 pm »
In addition,

changing settings in the settings menu "sometimes" my customized default color highlight choices are lost. The
default colors turn to the original setting, loosing my customization.

I lost, for example, the color stettings change the toolbar icon size from 22x22 to 16x16 an back to 22x22.
This is an example. There are other ways to reproduce the bug, playing with the settings option it is simple to
observe the bug.

Am I doing something in the wrong way? Is the "default" not customizable?

Regards

Max

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2778
Re: Syntax Highlighting bug
« Reply #2 on: April 07, 2006, 06:54:04 pm »
Your're not alone. A number of us are experiencing
the loss of editor settings. Posts about this are
all over the forum.

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Syntax Highlighting bug
« Reply #3 on: April 11, 2006, 03:20:49 pm »
Your're not alone. A number of us are experiencing
the loss of editor settings. Posts about this are
all over the forum.
true,

bump

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2778
Re: Syntax Highlighting bug
« Reply #4 on: April 11, 2006, 06:10:55 pm »
Your're not alone. A number of us are experiencing
the loss of editor settings. Posts about this are
all over the forum.

It seems that in default.conf, only the current changes are being recorded.
For example, here is Active line before changing the background.
Code
				<cc>
<style17>
<BACK>
<colour r="255" g="0" b="255" />
</BACK>
<NAME>
<str>Active line</str>
</NAME>
</style17>


Here is what is recorded when next changing the background.
Code
				<cc>
<style0>
<BACK>
<colour r="255" g="222" b="168" />
</BACK>
<NAME>
<str>Default</str>
</NAME>
</style0>

The active line change has been wiped out.

Will see if I can find the source of this...
« Last Edit: April 11, 2006, 06:12:45 pm by Pecan »

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2778
Re: Syntax Highlighting bug
« Reply #5 on: April 11, 2006, 11:31:16 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);

thanks
pecan