A problem noted by many (including in the perl.vim indent file)
is incorrect functioning of indentation when using a widely
used (e.g. from 'perltidy') formatting.  Example:

my @foobar = (  1,
                2,
                );
my $nextstatement=1;

The above isn't indented properly, but is indented as:

my @foobar = (  1,
                2,
                );
                my $nextstatement=1;


(using 'perl.EXT' to mean EXT/perl.vim):
It **appears** that perl.indent relies on perl.syntax and
the latter doesn't have a way to identify continuation lines.

Even given that restriction, it's a bit odd, in that perl.indent
seems to 'loop backwards' looking for some format of statement
line.
perl.syntax has separate perlstatementX lines for various types
of perlstatements. All of the perlstatementX types are OR'ed together to determine if it is a perlstatement.

The indent file takes the indent from the previous perlstatement
line. If that's the case, I don't understand why it doesn't
match on the line with the 'my', but instead matches on a continuation
line.

I made a preliminary attempt to create a perlstatementXstart pattern
that has they various keywords (like 'my') that perlstatementX has, and
changing perlstatementX to only be those lines that have a semicolon
in them. Perhaps it wasn't using the files I expected (I was using my
workfiles in my local ~/.vim/{syntax,indent} tree.  Maybe they were
ignored for ones in the distribution dir @ /usr/share/vim/vim72/{syntax,indent}...

But still, I'm not sure why the standard statements 'match' when
perl.syn is looping backwards looking at lines.

This is my first attempt to look at indent files and near the first attempt to look at a syntax file (added some keywords in a syntax
file but that's a very simplistic change, and not one that takes much
understanding!)....  So I really have little clue as to why things
are working they way they are.

Should my preliminary attempt worked (i.e. does the local dir overrride
the install dir?)  Even if it didn't why does the indent file
'match' on the partial lines even when they don't contain the
appropriate 'keywords' (like 'my' in my above example).


Thanks for any ideas....maybe this is another one of those intractable problems like highlighting of UTF-8 chars, I don't know, but it doesn't
seem that it should be.  But if it wasn't, given the number of
people with a similar problem when I goog'ed for solutions on the net,
I'm surprised it hasn't been addressed yet.

Thanks!
Linda


--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to