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

Re: A doubt with "syntax region"

Expand Messages
  • DervishD
    Hi Andy :) ... I thought that you cannot use matchgroup with the same group as the region group. That is, that the only use of matchgroup was to have a
    Message 1 of 3 , Jan 26, 2007
    View Source
    • 0 Attachment
      Hi Andy :)

      * Andy Wokula <anwoku@...> dixit:
      > DervishD schrieb:
      > > That is, the contained item is "swallowing" part of the "start"
      > >match!. I thought that when the match for "start" was performed, the
      > >matched test wasn't tried for any other match, including "contained"
      > >items. Obviously, I was wrong (or I misunderstood the entire issue), and
      > >I don't know if, just using regions, I can have a match like this:
      > >
      > > example{{weird} and some mor{}e text}
      > > ^^^^^^^^++++++++++++++++++++++++++++^
      > >
      > > that is, that the first opening brace is not "swallowed" by the
      > >contained syntax item. As you can see, the contained item must be
      > >allowed to start with "{".
      > >
      >
      > :h :syn-matchgroup
      >
      > | In a start or end pattern that is highlighted with "matchgroup" the
      > | contained items of the region are not used. This can be used to avoid
      >
      > e.g.
      > syntax region SomeRegion matchgroup=SomeRegion start="\I\i*{" ...

      I thought that you cannot use "matchgroup" with the same group as
      the region group. That is, that the only use of matchgroup was to
      have a region highlighted the region color and the separators
      highlighted in a *different* color. I didn't carry a test for this!

      Moreover, I considered that if you used the same group both for the
      region and for "matchgroup", you will end up with the entire region
      highlighted with the group color: the text withing the region because
      you issued a "syntax region Group" and the separators because you did
      the "matchgroup" thing. So, I didn't even consider that the *inside* of
      the region won't be colored at all.

      This is for sure my fault, I misunderstood this because I didn't
      noticed this paragraph:

      In a start or end pattern that is highlighted with "matchgroup" the
      contained items of the region are not used. This can be used to avoid
      that a contained item matches in the start or end pattern match. When
      using "transparent", this does not apply to a start or end pattern
      match that is highlighted with "matchgroup".

      Sorry for the inconvenience, I really thought I had read all the
      relevant help for this issue, I'm embarrased O:))))

      Thanks a lot, Andy, for your kind answer with the solution :)

      Raúl Núñez de Arenas Coronado

      --
      Linux Registered User 88736 | http://www.dervishd.net
      It's my PC and I'll cry if I want to... RAmen!
    Your message has been successfully submitted and would be delivered to recipients shortly.