News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Code Folding Bugs (Solved Again... and Again)

Started by joubertdj, December 05, 2006, 03:15:00 PM

Previous topic - Next topic

joubertdj

An interesting bug has occurred when I played around with code folding. It is not a major crash bug just maybe a visual/functional bug. Okay so I enabled all three code folding options (including Fold preprocessor commands) now I enabled this and enabled that code folding needs to fold everything at startup. Okay... exit and restart your project that even your header pre-processor (#ifndef _HEADER_H) is basically the only visible line( that and end of line) Now... go to settings and disable the Fold Pre-Processor tab in folding without opening up the folded _HEADER_H part... when you have done that (clicked OK) the two lines stil stay there and you can not go within the Pre-Processor part. Imaged attached.



PS. Using SVN Version of C::B with wxWidgets 2.6.3 + Pacthes

Can someone confirm this please?


[attachment deleted by admin]

joubertdj

Okay... I think I have an idea how to fix this... I found the function that will fix everything after you changed your settings : void ToggleAllFolds(); (cbeditor.h) If I understand correctly... and my understanding is limited... this will fold everything that needs to be folded after you change your settings without keeping things folded without a way of accessing them?

Problem is where do I place this call after you pressed the "okay"?

Can some developer help me please so that I can test this?

joubertdj

Hmm...  :?

Okay so in editormanager.cpp line 273 to 279 one has to tell the code folding part that if you disabled a folding option and it is still folded, you first need to expand the folded part before you return to the editor... else the bug that you can't see your codes or expand it... (with the little plus button)

Does this make sense so far? Anybody?

dje

No, you're not alone  :)

In fact, I never use folding, that's why I didn't answer you before.

Your investigation looks interesting and I hope it will end with a C::B improvement !

Dje

joubertdj

 :D Yeah... bug fixed... :D

The delay was due to the fact that I am buying a house, my boss wants to squeeze every drop of company resource out of me before Friday, and my wife also needs some attention  :lol:

Okay so I clean my C::B, do a SVN update and do the change and then do the SVN patch right?


joubertdj

 :) Submitted as: Patch Nr.: 001715

joubertdj

 :? Now to tackle the other code folding bugs...

killerbot

Quote from: joubertdj on December 12, 2006, 08:35:52 AM
:) Submitted as: Patch Nr.: 001715

nice work, patch will be applied shortly ;-)

joubertdj

 :D Another Patch for other Code Folding Bug Nr 006965. Patch Number: 001716  :D

killerbot

there's a side effect :

consider this as the contents of a header file :

#ifndef _NETSAL_H_INCLUDED_
#define _NETSAL_H_INCLUDED_

namespace ns
{

class CTest
{
  CTest();
};

} // namespace ns
#endif // _NETSAL_H_INCLUDED_


When it was initially not folded at all, and I turn on the fold of the preprocessor, then when I return to my editor, it is folded.
Not good : I allowed preprocessor stuff also to be folded, but it shouldn't be done automatically.

So now that my entire header is folded, let's continue the test : Back to the options and untick the preprocessor folding. Now when I arrive back in my editor, the preprocessor stuff is no longer folded (good) BUT in my example the namespace is folded --> NOT good.

joubertdj

#10
 :? The problem that I am experiencing is that Scintilla does not "remember" what was where, and which one is a comment fold, and which one is a xml, html, or other fold...

EDIT: So I only unfold all... and fold them after the Style change...

EDIT: Should I write a a fixed proc for each foldable part (3 in total?)

killerbot

well I think , sticking to the current bug you mentioned at the beginning of this post.
Some folding is on (eg preprocessor) and then you turn it off =--> then only that specific folding that was turned off should unfold all it's folded instances.

When you turn on a folding, nothing should happen automatically, it will just allow a new type of folding.

joubertdj

Okay... so back to the whole API freeze thing... if I add then three procedures, one for each option within the folding options ... will that be okay?

killerbot

#13
on 1 method with parameter : enum values which could be combined by or-ing them ??

[edit] : give it a try and we will look at it ;-)
[edit] : keep in mind that you discovered a nasty bug, which can be work around by closing and opening the file again, but it might scare the users to see that their header has shrun to 1 line ...

joubertdj

#14
Sounds good, let met see what I can do with it...

[edit] : true... but how many times will you be changing the code folding settings anyway... ?