On Mon, Nov 17, 2008 at 02:05:55AM +0300, Alexander V Alekseev wrote:
> Hello!
>
> When folding is on (foldmethod=syntax, syntax-perl) current
> indent script advises this style:
> ---------- test.pl -------------
> sub aa() {
> my $a;
> if (aaa) {
> if (bbb) {
> ccc
> }
> return 1;
> }
> }
> -------------------------------
>
> It seems to me that indent/perl.vim lacks support for new (?) syntax ids
> "perlBlockFold" and "perlSubFold". The patch is attached to let the
> script indent the same file this way:
>
> ---------- test.pl -------------
> sub aa() {
> my $a;
> if (aaa) {
> if (bbb) {
> ccc
> }
> return 1;
> }
> }
> -------------------------------
>
>
> Bye. Alex.
> >
I think this is good.
> --- perl.vim.orig 2008-09-24 17:23:58.000000000 +0400
> +++ perl.vim 2008-11-17 00:56:17.000000000 +0300
> @@ -131,6 +131,8 @@
> " 'perlHereDoc' is here only to handle the case '&foo(<<EOF)'.
> if synid == ""
> \ || synid == "perlMatchStartEnd"
> + \ || synid == "perlBlockFold"
> + \ || synid == "perlSubFold"
> \ || synid == "perlHereDoc"
> \ || synid =~ "^perlFiledescStatement"
> \ || synid =~ '^perl\(Sub\|BEGINEND\|If\)Fold'
> @@ -148,6 +150,8 @@
> let synid = synIDattr(synID(v:lnum, bracepos, 0), "name")
> if synid == ""
> \ || synid == "perlMatchStartEnd"
> + \ || synid == "perlBlockFold"
> + \ || synid == "perlSubFold"
> \ || synid =~ '^perl\(Sub\|BEGINEND\|If\)Fold'
> let ind = ind - &sw
> endif
--
Erik Falor
Registered Linux User #445632 http://counter.li.org
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---