I don't think I have a prioritization/conflict problem, since I'm testing in a buffer without any other syntax (using only one "match" or "syn match" at a time), and against lines containing only [a-z] (though it was informative to read the archived post, thanks).
As far as I can tell, there is just some difference in the way "match" and "syn match" apply the \%l atom. For example, even simply syn match Visual /\%5l/ doesn't highlight anything. It seems that "match" is maybe doing some extra magic causing \%5l to match line 5, where as "syn match" is considering \%5l as a starting position only. I was prototyping my highlighting idea with "match", and was confounded by the fact that everything I made work with "match" didn't apply to "syn match" :-) On 4/23/06, Yakov Lerner <[EMAIL PROTECTED]> wrote: > 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 >
