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.
(http://cbfoldbug.jpg)
PS. Using SVN Version of C::B with wxWidgets 2.6.3 + Pacthes
Can someone confirm this please?
[attachment deleted by admin]
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?
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?
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
: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?
:) Submitted as: Patch Nr.: 001715
:? Now to tackle the other code folding bugs...
Quote from: joubertdj on December 12, 2006, 08:35:52 AM
:) Submitted as: Patch Nr.: 001715
nice work, patch will be applied shortly ;-)
:D Another Patch for other Code Folding Bug Nr 006965. Patch Number: 001716 :D
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.
:? 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?)
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.
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?
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 ...
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... ?
:x I have trouble determining if the line is a pre-processor, comment, or xml...
:? Scintilla bug... bug report filed at Scinitilla...
PS the other bug fix I posted actually works...
EDIT: Working for a hack around the scintilla bug...
Hey killerbot... I am not currently at my home pc... so here is the solution... sorry it is not in patch format... will only be able to get it to you by the end of tommorrow in patch format...
[attachment deleted by admin]
no problem, I will try to take a look at it tomorrow, otherwise it will be for sunday.
[EDIT] : you can update your patch with this new code, and I will apply it then together with your other patch concerning folding. Should be able to apply it to my work copy at work and see how it behaves friday morning. So maybe i can already path then friday afternoon ...
:) Patch Uploaded...
Lets hope this one does the trick...
The patch includes the other patch of code folding and the limited amount of tests that I ran worked fine...
Patch number: 001715
Question about a new Code Folding deletion bug number: 009380
If you read about the comments at berlios. Do you want this to delete the whole hidden part, or just delete the one line and unhide the others?
Dawie
[EDIT]... Not even sure it is fixable (Scintilla?) ... but hey ... will check
Quote from: joubertdj on December 14, 2006, 07:10:04 AM
:) Patch Uploaded...
Lets hope this one does the trick...
The patch includes the other patch of code folding and the limited amount of tests that I ran worked fine...
Patch number: 001715
applied : good work !!!
Code Folding Deletion Bug uploaded:
PatchNr: 1801
http://developer.berlios.de/patch/index.php?func=detailpatch&patch_id=1801&group_id=5358 (http://developer.berlios.de/patch/index.php?func=detailpatch&patch_id=1801&group_id=5358)
:) Oh yeah... will be here now for the other patches' support :)