> Is is possible to change background for range of lines without
> suppressing the other syntax highlighting in the range ?
>
> (I tried something simpler and less useful - match by range of
> lines (:match Search /\%123l\_.*\%999l/ which suppresses
> highlighting in the region) but even this did not work when
> the range if bigger than 1-2 screens (this is by design as
> Bram explained)
I suspect you're butting against the information described in
":he :syn-sync-maxlines".
If you slightly tweak your regexp, it should be able to do it on
a per-line basis rather than as a single match (which encompasses
all the lines of interest):
:match Search /\%>20l\%<30l.*/
This even allows crazy disjoint sets:
:match Search /\(\%>20l\%<30l\|\%>80l\%<90l\).*/
so you can have multiple spans (in this case, lines 21-29 and
82-89). Just remember your fenceposting, that that's "greater
than line 20", so if you want to highlight from lines 20-30, you
have to use "greater than line 19" and "less than line 31". A
bit of a wart, but until there's a "\%>=20l" flavored operator,
it will have to do. :)
You're obviously already aware of the \%#l format tag, but might
have missed the variants of "\%<#l" and "\%>#l" in the same
section of the help
:help /\%l
-tim