I've tried to look into the code to find the source of this behavior,
but eventually decided that trying to understand what it does would
take me too much time so I gave up.

I had a quick look, too, and haven't spotted the bug yet.

Note that your second example is a red herring:

   <a[a<a>a]a>

is highlighted correctly. :syn match rules cannot nest (or overlap), so
the brackets correctly extend the match that originally spanned
characters 1-7 to span characters 1-9.

Your other two examples demonstrate the strange behaviour. Here's an
even simpler case:

sy clear

sy region braces
\ matchgroup=Type start=/{/ end=/}/
\ contains=parens keepend

sy region parens
\ matchgroup=Statement start=/(/ end=/)/
\ contains=parens extend

hi link braces Comment
hi link parens PreProc

finish

{a(a(a(a)a)a)a}

I just have it in a single file and use :sou % to (re)load it.

Ben.



--
You received this message from the "vim_dev" 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

Raspunde prin e-mail lui