NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Code folding - try again?


Joined: 27 Apr 2007
Posts: 72
Reply with quote
Hello,

I must say I am very happy that we have code folding... but... it is almost unusable. Here is
a list what I think would make folding really great. It is sorted by my priority.

1) Shortcut to fold/unfold current fold block (I can not understand why we do not have these) - one key please, open/close, simple
2) Persistent "temporary" fold - when I select code, foldit, unfoldit - fold is gone!? What the hell?
3) Folding of if-else, foreach and BLOCKS! ({...})... and arrays (I mean long definition of arrays) - persistent again
4) When I select big part of code to foldit, I have to scroll-up to find this tiny (-) button, totally unreliable. (point 1 solves this)
5) Ability to fold in JAVASCRIPT or at least JAVASCRIPT as whole
6) Ability to fold any HTML TAG (which would partly implement 5. )

Please think about it, I really feel that at this point folding is really at 5% of its usefulness... Sad
Thanks and keep up the good work!
View user's profileFind all posts by sirjardaSend private message
Re: Code folding - try again?
Guru master

Joined: 05 Jul 2004
Posts: 659
Location: Belgium
Reply with quote
sirjarda wrote:
1) Shortcut to fold/unfold current fold block (I can not understand why we do not have these) - one key please, open/close, simple

You might want to check out the shop, there's a new build that has this.

sirjarda wrote:
2) Persistent "temporary" fold - when I select code, foldit, unfoldit - fold is gone!? What the hell?
3) Folding of if-else, foreach and BLOCKS! ({...})... and arrays (I mean long definition of arrays) - persistent again

Couldn't agree more Smile
View user's profileFind all posts by BlizzSend private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 8246
Reply with quote
Quote:
2) Persistent "temporary" fold - when I select code, foldit, unfoldit - fold is gone!? What the hell?


Persistent "temporary" - that sounds good! Smile Aren't the terms mutually exclusive?
PhpED's editor marks selected text as folds that you may collapse. Once you expand them, they will be converted to selected block again. If you move cursor, that text may become unselected and therefore fold is not available for it anymore.

as of the rest, I agree and actually we're moving in that directions.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Guru master

Joined: 05 Jul 2004
Posts: 659
Location: Belgium
Reply with quote
Lol dmitri Smile

I actually like the temporary folds, but I was silently hoping on a key combo to toggle a folds' persistence.
ie you select, you press keycombo: fold is persistent, you press combo "within" the fold again, returns to a normal selection or something similar.
But if all block elements could be folded (which you seem to indicate), I don't think there is much need for that anyway...
View user's profileFind all posts by BlizzSend private messageVisit poster's website


Joined: 27 Apr 2007
Posts: 72
Reply with quote
[quote="dmitri"]
Quote:
2) Persistent "temporary" fold - when I select code, foldit, unfoldit - fold is gone!? What the hell?


Quote:

Persistent "temporary" - that sounds good! Smile Aren't the terms mutually exclusive?
PhpED's editor marks selected text as folds that you may collapse. Once you expand them, they will be converted to selected block again. If you move cursor, that text may become unselected and therefore fold is not available for it anymore.


Heh, of course... I am not speaker English (unfortunatelly for me it is too obvious...) , and I could not find right term for "temporary" fold. Maybe I should call it "freeform" fold Smile But - If this temporary/freefold would be persistent by default, then it would be great Smile
View user's profileFind all posts by sirjardaSend private message
Re: Code folding - try again?


Joined: 27 Apr 2007
Posts: 72
Reply with quote
[quote="Blizz"]
sirjarda wrote:
1) Shortcut to fold/unfold current fold block (I can not understand why we do not have these) - one key please, open/close, simple

You might want to check out the shop, there's a new build that has this.

Oh great!!! Thanks
View user's profileFind all posts by sirjardaSend private message
Guru master

Joined: 05 Jul 2004
Posts: 659
Location: Belgium
Reply with quote
sirjarda wrote:
Heh, of course... I am not speaker English (unfortunatelly for me it is too obvious...) , and I could not find right term for "temporary" fold. Maybe I should call it "freeform" fold Smile But - If this temporary/freefold would be persistent by default, then it would be great Smile


The joke is about something temporary that is persistent - they rule out each other Wink If it's temporary it doesn't last, something persistent lasts, see? Smile
View user's profileFind all posts by BlizzSend private messageVisit poster's website


Joined: 27 Apr 2007
Posts: 72
Reply with quote
Blizz wrote:
sirjarda wrote:
Heh, of course... I am not speaker English (unfortunatelly for me it is too obvious...) , and I could not find right term for "temporary" fold. Maybe I should call it "freeform" fold Smile But - If this temporary/freefold would be persistent by default, then it would be great Smile


The joke is about something temporary that is persistent - they rule out each other Wink If it's temporary it doesn't last, something persistent lasts, see? Smile


Yes yes I understand... It is funny... Smile
View user's profileFind all posts by sirjardaSend private message
Re: Code folding - try again?


Joined: 08 Sep 2006
Posts: 72
Location: Poland
Reply with quote
Blizz wrote:
sirjarda wrote:
1) Shortcut to fold/unfold current fold block (I can not understand why we do not have these) - one key please, open/close, simple

You might want to check out the shop, there's a new build that has this.

It has but it's still not perfect... I have so many shortcuts already that it was hard to set up another two for folding/unfolding area at cursor. Having TWO shortcuts for something that could be toggled with ONE is kinda inefficient for me.

Please consider making separate shortcut that would toggle the folding of the region at cursor.
View user's profileFind all posts by bartheqSend private message


Joined: 14 Feb 2007
Posts: 29
Reply with quote
I would like to see something more in line with what you would find in Csharp with the #region and #endregion directives which are designed to give editors hints for code folding. This would allow me to define custom regions that should have code folding and this would make it persistent to anybody who loads my code.

Now, given that php doesn't have a 'region' directive, but maybe this could be somewhat implemented by keyword or formation of comment section. Maybe something like '//region' to mark the begining, and '//endregion' to mark the end.
View user's profileFind all posts by snorkelbuckleSend private message


Joined: 11 Aug 2006
Posts: 15
Reply with quote
Yes, snorkelbuckle's idea is I think a good approach to the matter. I second that!! Wink
View user's profileFind all posts by thesilentmanSend private message
Guru master

Joined: 05 Jul 2004
Posts: 659
Location: Belgium
Reply with quote
Agreed. In combination with a little more detailed folding by default (if, for, foreach, while, ...) that would solve every "complaint" about the codefolding so far and would also save the NuSphere gents the effort of having to find something to store custom folds (if they were planning on doing so of course)
View user's profileFind all posts by BlizzSend private messageVisit poster's website
Code folding - try again?
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 2  

  
  
 Reply to topic