On 4/23/06, Eric Arnold <[EMAIL PROTECTED]> wrote:
> I'm trying to highlight a rectangle.
>
>      syn match EVB_window /\%>1l\%>1c\%<5c\%<4l/
> or
>      syn match error /\%1l/
>
> don't work.  This does:
>
>     match VIsual /\%>1l\%>1c\%<5c\%<4l/
>
> It appears that I have to use this:
>
> syn clear
> syn match EVB_window_lines /\%3l\_.*\%7l/
> syn match EVB_window_cols /\%5c.*\%15c/ containedin=EVB_window_lines contained
>
> hi link EVB_window_cols error
>
> Should I be able to use  \%>  in syntax highlighting, as with simple
> 'match' highlighting?

I think you have same problem that I had I had recently.
It was discussed on this list in long thread "highlighting function
header, again".
Problem: regexp that works in the 'match' does not work in 'syn match'.

This problem arises because 'match and 'syn match'
have different highliting priorities. 'match' has top priority.
'syn match'  has lower priority. Read details at
    http://marc.theaimsgroup.com/?l=vim&m=114321198924381&w=2
by Charles Campbell. Both 'syn match' and 'match' recognize same
regexp syntax BTW.

You can experiment and see this in action if you prepare  several
lines which contain
no keywords and no syntax-highlighted items. Apply your 'syn match'.
You'll see it works in this situation. It follows that the reason is not in
regexp, but in "priorities".

On the solution's side ... the only solution I found so far is just
to use match/2match/3match. Didn't find any other soltution.
Tell us if you find other solution.

Yakov

Reply via email to