in reply to Code Folding
For folding it doesn't matter if the below is folded recursively. It is more important for unfolding. It allows you to unfold an entire sub, or just the single level.
Imagine:
sub abc { my ($x) = @_; my $z; foreach my $y (@{ $x }) { # do xxx # on # lots # of # lines } return $z; }
when it is folded it would be (kinda like this in vim)
+-- 14 lines: sub abc {
when you unfold, would you get back the initial example, or
sub abc { my ($x) = @_; my $z; +--- 7 lines: foreach my $y (@{ $x }) { return $z; }
That is the purpose of recursive folding IMHO.
In Vim, it remembers the folded status of things, so if it is in the first example and you fold to the second example, when you unfold, it goes back to the first example. However, if you fold recursively, the default unfold will unfold to the third example.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Code Folding
by sir_lichtkind (Friar) on Dec 30, 2008 at 12:47 UTC | |
by afresh1 (Hermit) on Dec 30, 2008 at 18:16 UTC | |
by sir_lichtkind (Friar) on Jan 01, 2009 at 23:48 UTC | |
by eric256 (Parson) on Dec 30, 2008 at 21:37 UTC | |
by sir_lichtkind (Friar) on Jan 01, 2009 at 23:53 UTC |