On Nov 5, 2:20 pm, "Benjamin Fritz" <[EMAIL PROTECTED]> wrote:
> On Wed, Nov 5, 2008 at 1:18 PM, Frew <[EMAIL PROTECTED]> wrote:
>
> >> Two bugs that I've found while using this patch with realperlcode:
>
> >> 1) Commented-out lines can end a fold region
> >> 2) The closing brace in code like $abc{def} ends fold regions
>
> >> Bug 1 is fixed by adding a skip group to the perlSubFold and
> >> perlBlockFold definitions: skip="#.*"
> >> Bug 2 is something I will try to fix later unless someone beats me to
> >> it.
>
> >> I have yet to see any feedback or developments on this other than an
> >> "I'll look at it" from the script maintainer. Has anyone tried this?
>
> > I just found this and patched the file. Maybe I patched it
> > incorrectly (I don't have patch handy atm) but it seems to fold
> > anything with { and }, that is, if I do this:
>
> > sub foo {
> > $blah->bar($self->{test});
>
> > more..
> > }
>
> > just the first two lines get folded.
>
> > Hope that helps some.
>
> > -fREW
>
> That does help some, it falls into bug (2) that I listed, which I
> suspect is very common.
>
> Unfortunately, I am very much a beginner atperl, and am not very
> familiar with thesyntax, so it may take me a little while. I suspect
> the best way to proceed might be to just make another group that folds
> all {...} blocks that aren't the special cases like if, sub, etc. I'll
> try to get to it sometime this month, unless someone else fixes it
> first of course :-)Actually the fix was fairly easy. Most of the code was already there. I fixed bug 2 as follows: * Force behavior as if perl_extended_vars was set if perl_fold is set. * Add an "extend" keyword to quote/match/string/substitution groups I also fixed another bug where some character was required to occur on the same line as a BEGIN, END, etc. or sub block after the opening keyword for the group to match. See attached patch, which is (so far as I know) bug free (or at least, doesn't introduce any bugs). I may have missed some string/quote/match/etc. groups, though...there are quite a few. --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
perl.vim.patch
Description: Binary data
