Bug#458630: vim-runtime: the wrong syntax highlight of the program code in Perl

James Vega jamessan at debian.org
Wed Jan 2 20:49:17 UTC 2008


On Wed, Jan 02, 2008 at 10:33:24PM +0300, Dmitry E. Oboukhov wrote:
> On 12:33 Wed 02 Jan     , James Vega wrote:
> JV> On Wed, Jan 02, 2008 at 12:27:29PM +0300, Dmitry E. Oboukhov wrote:
> >> For all that in the majority of cases after the open marker (<<endquote)
> >> there's needed some statement, for example semicolumn, closing bracket,
> >> etc.
> >>
> >> Example:
> >>
> >> $dbh->do(<<endsql, undef, $cid);
> >> DELETE FROM query
> >> WHERE query.id=?
> >> endsql
> >>
> >> Parameters written after open marker will colour wrongly.
> 
> JV> Vim's current syntax highlighting capabilities are unable to properly
> JV> highlight this.  It's not possible to define a syntax region that skips
> JV> highlighting part of the region match.
> 
> If it is not possible to select strings by one rule then why not to
> select
> them by two rules?
> 
> For example
> 1. to consider as strings all the statements of the type:
> <<\w+
> 2. and also to consider as strings all the _strings_ between the string
> containing open marker <<(\w+) and the string ^$1$

Through a little fiddling around, I have a solution that almost works.
I'll have to bug Bram about whether or not I can finish getting it to
work.  Basically, I can get the exact code snippet above to highlight,
but the region syntax (your #2) never ends so any code after it stays
highlighted as a string.

It'll likely require a patch against Vim's source though instead of
simply the highlighting script.  I'm not sure I have time to do that
right now.

James
-- 
GPG Key: 1024D/61326D40 2003-09-02 James Vega <jamessan at debian.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/pkg-vim-maintainers/attachments/20080102/85f12f8e/attachment.pgp 


More information about the pkg-vim-maintainers mailing list