DONE: Code folding #region in PHP

Make a request or discuss new features.
Post Reply
crtrubshaw
Posts: 391
Joined: 06 Jun 2012 11:08

DONE: Code folding #region in PHP

Post by crtrubshaw »

Hi Rickard, is it possible for TextEd to recognise "#region... #endregion" as a fold node in PHP? I think it might be possible by editing PHP.syx but can't figure it out.

Thank you.
User avatar
pjj
Posts: 2268
Joined: 13 Oct 2009 13:48
Location: Kraków, Poland

Re: Code folding #region in PHP

Post by pjj »

Me neither; additionally //__START__ ... //__END__ doesn't work for me, either.
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus
User avatar
Rickard Johansson
Site Admin
Posts: 6900
Joined: 19 Jul 2006 14:29

Re: Code folding #region in PHP

Post by Rickard Johansson »

Fixed in next release (v16.37). Thanks!
crtrubshaw
Posts: 391
Joined: 06 Jun 2012 11:08

Re: DONE: Code folding #region in PHP

Post by crtrubshaw »

Hi Rickard, this appears to have stopped working (v16.55, 64-bit).
User avatar
Rickard Johansson
Site Admin
Posts: 6900
Joined: 19 Jul 2006 14:29

Re: DONE: Code folding #region in PHP

Post by Rickard Johansson »

Fixed in next version (v16.56). Thanks!
crtrubshaw
Posts: 391
Joined: 06 Jun 2012 11:08

Re: DONE: Code folding #region in PHP

Post by crtrubshaw »

Hello again, I have upgraded to v16.56 but it still doesn't create an automatic fold region, is there something I should check?

Thank you.
User avatar
Rickard Johansson
Site Admin
Posts: 6900
Joined: 19 Jul 2006 14:29

Re: DONE: Code folding #region in PHP

Post by Rickard Johansson »

Make sure the region labels are the first words found on the line (without spaces).

Code: Select all

//__START__
   // Code here
   if ( ) {
   
   }
//__END__
crtrubshaw
Posts: 391
Joined: 06 Jun 2012 11:08

Re: DONE: Code folding #region in PHP

Post by crtrubshaw »

Hi Rickard, I am using

Code: Select all

#region
...
#endregion
Please include this syntax in the fix.

Thank you!
User avatar
Rickard Johansson
Site Admin
Posts: 6900
Joined: 19 Jul 2006 14:29

Re: DONE: Code folding #region in PHP

Post by Rickard Johansson »

Until I implement a better solution you could replace

Code: Select all

[Fold]
1_Id=^//__START__
1_Begin=
1_End=^//__END__
in PHP.syx with

Code: Select all

[Fold]
1_Id=^#region
1_Begin=
1_End=^#endregion
crtrubshaw
Posts: 391
Joined: 06 Jun 2012 11:08

Re: DONE: Code folding #region in PHP

Post by crtrubshaw »

Thanks Rickard!

That does work, but it disables any fold regions in the region. It's not too serious at the moment because I typically want to collapse the region, but just saying, other fold regions don't do that.
User avatar
Rickard Johansson
Site Admin
Posts: 6900
Joined: 19 Jul 2006 14:29

Re: DONE: Code folding #region in PHP

Post by Rickard Johansson »

This should work properly now in the next release (v16.57). Thanks!
Post Reply