Page 1 of 2

Bug folding feature in Editor ?

Posted: Thu Nov 16, 2006 7:38 pm
by Psychophanta

Code: Select all

Macro tro()
  Enumeration
    #a
    #b
  EndEnumeration
  Structure aaa
    a.l
    b.f
  EndStructure
  DataSection
  Data$ "hi"
  EndDataSection
EndMacro
Here the DataSection block, the Structure block and the Enumeration one are not folded with folding feature enabled.
But sometimes when editing they appear folded. :roll:

Posted: Thu Nov 16, 2006 9:34 pm
by freak
No folding inside macros. It is by design, not a bug.

Posted: Thu Nov 16, 2006 9:41 pm
by AND51
No, Psychophanta is right: Folding with Macros is definetyl buggy!

I added a folding option at the IDE preferences; now I can fold Macros as esayly as Procedures. But sometimes, the folding-line does not go from Macro till the line containing 'EndMacro', but it goes till the next folding-keyword or till the end of the document.

To geet rid of this bug, I always save my work and re-start the IDE.

Posted: Thu Nov 16, 2006 9:47 pm
by Trond
freak wrote:No folding inside macros. It is by design, not a bug.
Actually he said that problem was that they was folded even though they were inside the macro.

Posted: Thu Nov 16, 2006 9:52 pm
by AND51
I already understand, trond. But "my" bug also occurs, when not nesting folding keywords.
In other words: Although I don't fold inside macros, this bug appears.

Posted: Thu Nov 16, 2006 10:46 pm
by AND51
Now, I can show you, what I mean:
Image
Picture, showing that macro-folding is buggy © AND51


This problem only occurs with macros - procedures, ;{, ;}, Enumeration, EndEnumeration... They are all good to fold, no problems...

Posted: Thu Nov 16, 2006 10:57 pm
by Psychophanta
freak wrote:No folding inside macros. It is by design, not a bug.
Fr34k, can explain a little "why" for that answer?
I find no reason to avoid folding inside macros and not inside procedures for example.
Mmm, you have most times a quick answer. Remember when discussing about paragraph alignment in editor, you answered there was no solution for it, but finally you solved it... :wink:

Posted: Thu Nov 16, 2006 11:50 pm
by freak
Psychophanta:
Macros can contain very weird constructs that would screw up the folding of the entire document.
For example you could have a macro that only contains fold start words, but no end words. This
fold point would stay open for the entire document, because there is no end word.
Thats why it was disabled.


AND51:
You have to tell me how to reproduce it, or i can do nothing.
Your nice copyrighted image is of no help. ;)

Posted: Fri Nov 17, 2006 12:00 am
by AND51
In this special case the procedure SetLanguage() existed before creating/editing the macro.
I just edited/inserted the macro Language(); when finishing the macro by typing EndMacro in line 3 the folding-line in line 4 did not disappear.
If I now collapse (fold) the macro by clicking on the [-] in line 1, the next procedure also disapperas.

Furthermore, this bug sometimes occurs, when writing code from top to bottom. Means, first I create the macro, then creating the procedure, it looks like in my picture.

My computer is brand new, I also installed PB and PB IDE new incl. Update 4.01. So I conclude that it's not my computer's fault. Moreover, this bug also occured in eralier PB version 4.00 (since macros exist).

Posted: Fri Nov 17, 2006 8:23 am
by Psychophanta
freak wrote:Psychophanta:
Macros can contain very weird constructs that would screw up the folding of the entire document.
For example you could have a macro that only contains fold start words, but no end words. This
fold point would stay open for the entire document, because there is no end word.
Thats why it was disabled.
Again, if that is the excuse, then take a look at this and see yourself the incoherence of that explanation:

Code: Select all

Procedure tro() 
  Enumeration 
    #a 
    #b 
  EndEnumeration 
  Structure aaa 
    a.l 
    b.f 
  EndStructure 
  DataSection 
  Data$ "hi" 
  EndDataSection 
EndProcedure
Here the folding works as it must. :wink:

Posted: Fri Nov 17, 2006 8:54 am
by gnozal
Psychophanta wrote:Here the folding works as it must. :wink:
Of course.
For each fold start word there is a fold end word (and in the correct order), wich may not be the case in a macro.

Posted: Fri Nov 17, 2006 10:19 am
by Psychophanta
gnozal wrote:For each fold start word there is a fold end word (and in the correct order), wich may not be the case in a macro.
Well, i see the point. :) Then there is a small bug because while editing inside the macro (see the first post), folding appears and dissappears.

Posted: Fri Nov 17, 2006 11:33 am
by Trond
freak wrote: AND51:
You have to tell me how to reproduce it, or i can do nothing.
Your nice copyrighted image is of no help. ;)
That happens all the time here, I should be able to give you a step-by-step guide later, but now I'm not at home.

Edit: AND51: Have you found the secret F12 key? You don't have to restart the entire IDE.

Posted: Fri Nov 17, 2006 11:46 am
by Dare
There is a problem with the Macro folding. It is not serious, just double take stuff. It may be cosmetic or a redraw thing.

Open a new document.
Type Macro hit enter
Type anything hit enter
Type EndMacro hit enter
Arrow up to the top, so the cursor is before the Macro
Hit enter a few times. You have an orphaned [-]
Hit backspace. You get the vertical folding line extend beyond the EndMacro.

The above happens almost 100% of the time here. I would say 100% but I may be lying. Very Often is accurate.


There is another problem, often but not always. In a document with code, scroll back towards the top.
Type Macro Name(par,whatever) hit enter.
Vertical Line extends down to EndMacro of macro below, or just extends (this is not the bug)
Type gobblydegook or something, hit enter.
Type EndMacro, hit enter. This EndMacro is not recognised, or is not shown to be recognised (no little horizontal line and the vertical still plunges down)

The above happens quite often. Not always. And clicking the [-] does not fold the macro, so this may not be cosmetic.

Not sure because ..

Have another document loaded. Hit the tab for the second doc so the original is hidden. Hit the tab for the original doc. Viola. All looks good. Click [-] and [+] to fold/unfold at will.


So maybe just a redraw thing?

Posted: Fri Nov 17, 2006 12:58 pm
by AND51
Trond wrote:Edit: AND51: Have you found the secret F12 key? You don't have to restart the entire IDE.
Hey, thanks a lot! I should "learn" the default hotkeys by hard... I just remember those, I use regularyly, but F12, for example, I don't use regularyly.