Author Topic: Code Folding Bugs (Solved Again... and Again)  (Read 14116 times)

Offline joubertdj

  • Multiple posting newcomer
  • *
  • Posts: 120
Code Folding Bugs (Solved Again... and Again)
« on: December 05, 2006, 03:15:00 pm »
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]
« Last Edit: December 14, 2006, 07:39:55 am by joubertdj »

Offline joubertdj

  • Multiple posting newcomer
  • *
  • Posts: 120
Re: Code Folding Bug (Solved?)
« Reply #1 on: December 06, 2006, 02:57:53 pm »
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?

Offline joubertdj

  • Multiple posting newcomer
  • *
  • Posts: 120
Re: Code Folding Bug (Solved?)
« Reply #2 on: December 08, 2006, 11:09:01 am »
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?

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: Code Folding Bug (Solved?)
« Reply #3 on: December 08, 2006, 11:14:20 am »
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

Offline joubertdj

  • Multiple posting newcomer
  • *
  • Posts: 120
Re: Code Folding Bug (Solved!)
« Reply #4 on: December 12, 2006, 08:29:50 am »
 :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?


Offline joubertdj

  • Multiple posting newcomer
  • *
  • Posts: 120
Re: Code Folding Bug (Solved?)
« Reply #5 on: December 12, 2006, 08:35:52 am »
 :) Submitted as: Patch Nr.: 001715

Offline joubertdj

  • Multiple posting newcomer
  • *
  • Posts: 120
Re: Code Folding Bug (Solved)
« Reply #6 on: December 12, 2006, 08:38:54 am »
 :? Now to tackle the other code folding bugs...

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
Re: Code Folding Bug (Solved?)
« Reply #7 on: December 12, 2006, 01:48:14 pm »
:) Submitted as: Patch Nr.: 001715

nice work, patch will be applied shortly ;-)

Offline joubertdj

  • Multiple posting newcomer
  • *
  • Posts: 120
Re: Code Folding Bug (Solved)
« Reply #8 on: December 12, 2006, 02:37:26 pm »
 :D Another Patch for other Code Folding Bug Nr 006965. Patch Number: 001716  :D

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
Re: Code Folding Bug (Solved)
« Reply #9 on: December 12, 2006, 02:48:32 pm »
there's a side effect :

consider this as the contents of a header file :
Code
#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.

Offline joubertdj

  • Multiple posting newcomer
  • *
  • Posts: 120
Re: Code Folding Bug (Solved)
« Reply #10 on: December 12, 2006, 02:50:41 pm »
 :? 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?)
« Last Edit: December 12, 2006, 02:52:25 pm by joubertdj »

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
Re: Code Folding Bug (Solved)
« Reply #11 on: December 12, 2006, 03:01:41 pm »
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.

Offline joubertdj

  • Multiple posting newcomer
  • *
  • Posts: 120
Re: Code Folding Bug (Solved)
« Reply #12 on: December 12, 2006, 03:04:41 pm »
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?

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
Re: Code Folding Bug (Solved)
« Reply #13 on: December 12, 2006, 03:07:56 pm »
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 ...
« Last Edit: December 12, 2006, 03:09:38 pm by killerbot »

Offline joubertdj

  • Multiple posting newcomer
  • *
  • Posts: 120
Re: Code Folding Bug (Solved)
« Reply #14 on: December 12, 2006, 03:09:20 pm »
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... ?
« Last Edit: December 12, 2006, 03:51:45 pm by joubertdj »