42050Re: :match and 'hlsearch'
- Mar 2 1:58 AMBenji Fisher wrote:
> On Thu, Mar 02, 2006 at 12:24:17AM +0100, A. J. Mechelynck wrote:Right. That's why I think three matches are enough. If you try to
> > Possibility 1: We already have named autocommand groups. Couldn't we
> > have similar (and similarly optional) match groups, thus allowing an
> > unlimited number of parallel (named) matches but keeping the present
> > behaviour by default (if no matchgroups are used)?
> > Possibility 2: Alternately, why stay at a meagre two or three? Let's
> > foresee ten of them (:match or :0match, :1match, .. :9match). As my old
> > chemistry teacher used to say: "If you want to have enough, make sure
> > you have too much."
> I like the first suggestion. Perhaps search highlighting could be
> made part of the :match hierarchy (matchgroup Search). One issue to
> consider is priority. If I have
> matchgroup Foo
> match Search /[aeiou]/
> matchgroup Bar
> match WarningMsg /[abcde]/
> matchgroup END
> then how does "a" get highlighted? I suggest letting the last-defined
> match win. I suspect it is easy to implement; it means that whatever
> match I define right now shows its effect immediately; and if
> "matchgroup Search" is defined internally, then :match has priority over
> hlsearch, so it is backwards compatible.
> Bram, once again you have proven that the problem with adding new
> features is that we users just ask for more. It is like juggling:
> "Wow, you can juggle four! Can you do five?"
juggle four you'll get confused and drop one.
You appear to underestimate the impact matches have on redrawing speed.
There is a penatly for having to redraw more often and a penalty per
character to check for highlighting. I rather have plugin developers
stuggle with the small number of matches available than me having to
struggle to keep redrawing speedy. Sometimes less is better.
How To Keep A Healthy Level Of Insanity:
7. Finish all your sentences with "in accordance with the prophecy".
/// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://www.ICCF.nl ///
- << Previous post in topic Next post in topic >>