Loading ...
Sorry, an error occurred while loading the content.

42047Re: :match and 'hlsearch'

Expand Messages
  • Benji Fisher
    Mar 1 8:53 PM
    • 0 Attachment
      On Thu, Mar 02, 2006 at 12:24:17AM +0100, A. J. Mechelynck wrote:
      >
      > 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?"

      HTH --Benji Fisher
    • Show all 21 messages in this topic