42043Re: :match and 'hlsearch'
- Mar 1, 2006mzyzik@... wrote:
>Ok I'm confused. What can ":match" do that ":syn match" cannot?Priority.
Example: assume one has a syn match for strings:
"this is a string that stretches out past 40 characters"
Assume one has a match:
match Error "/\%>40c"
With this setup, anything past column 40 will be Error highlighted.
However, changing that match to a syn match:
syn match Error '/\%>40c'
and you won't see any Error highlighting. Why? Because the string
highlighting began in column 2 *and continues*
until its match is over. Note that the string highlighting does not
contain the syn-match-Error. This problem is typical
of trying to shove a syn-match-Error of the sort shown into the
highlighting mix -- it doesn't have priority, isn't contained,
Furthermore, assume that you modify the string handling to contain your
new syn-match-error, but note that the string's
ending is inside the syn-match-Error, *not* inside the string match.
Now your strings won't terminate correctly.
- << Previous post in topic Next post in topic >>