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

Re: containedin can't include clusters

Expand Messages
  • Nikolai Weibull
    ... Ah, of course. How silly of me. Although, it would be nice if this could be done somehow. A pair of @ s, perhaps, e.g., syn match Something
    Message 1 of 5 , Oct 25, 2006
    • 0 Attachment
      On 10/25/06, Peter Hodge <toomuchphp-vimdev@...> wrote:

      > --- Nikolai Weibull <now@...> wrote:

      > > I figured that it was easier to add items to a cluster using
      > > containedin= for a syntax definition I'm writing, but it seems that
      > > one can't do it that way. Is there a reason for this, or is it an
      > > oversight? Can we add this to the todo? I've never needed it before,
      > > but for this particular grammar, it made a lot of sense.

      > Using 'syn keyword SomeKeyword foo containedin=@SomeCluster' does not add SomeKeyword to the cluster @SomeCluster, rather, it allows SomeKeyword be contained in all the items in @SomeCluster.

      Ah, of course. How silly of me. Although, it would be nice if this
      could be done somehow. A pair of @'s, perhaps, e.g., syn match
      Something containedin=@@Cluster '...'?

      nikolai
    • Peter Hodge
      ... Probably better if it was addto=@cluster rather than complicating the containedin option. If you are in the habit of spanning syntax commands across
      Message 2 of 5 , Oct 25, 2006
      • 0 Attachment
        --- Nikolai Weibull <now@...> wrote:

        > On 10/25/06, Peter Hodge <toomuchphp-vimdev@...> wrote:
        >
        > > --- Nikolai Weibull <now@...> wrote:
        >
        > > > I figured that it was easier to add items to a cluster using
        > > > containedin= for a syntax definition I'm writing, but it seems that
        > > > one can't do it that way. Is there a reason for this, or is it an
        > > > oversight? Can we add this to the todo? I've never needed it before,
        > > > but for this particular grammar, it made a lot of sense.
        >
        > > Using 'syn keyword SomeKeyword foo containedin=@SomeCluster' does not add
        > SomeKeyword to the cluster @SomeCluster, rather, it allows SomeKeyword be
        > contained in all the items in @SomeCluster.
        >
        > Ah, of course. How silly of me. Although, it would be nice if this
        > could be done somehow. A pair of @'s, perhaps, e.g., syn match
        > Something containedin=@@Cluster '...'?

        Probably better if it was 'addto=@cluster' rather than complicating the
        containedin option. If you are in the habit of spanning syntax commands across
        multiple lines, then it's pretty easy to make a new line to add the item to the
        cluster. I.e., if you have:

        syn match foo /foo/ contained
        \ addto=@myCluster

        then it could be

        syn match foo /foo/ contained
        syn cluster myCluster add=foo

        It's not so painful.

        cheers,
        Peter




        ____________________________________________________
        On Yahoo!7
        Win VIP tickets to meet R'n'B stars superstars Ne-Yo and Rihanna
        http://advision.webevents.yahoo.com/aunz/music/jay_z_promotion/index.htm
      • Nikolai Weibull
        ... Yes, it is, because many of the foo need to be added to two clusters, and it clutters up an already rather (unavoidably) cluttered syntax definition.
        Message 3 of 5 , Oct 25, 2006
        • 0 Attachment
          On 10/25/06, Peter Hodge <toomuchphp-vimdev@...> wrote:
          >
          > --- Nikolai Weibull <now@...> wrote:
          >
          > > On 10/25/06, Peter Hodge <toomuchphp-vimdev@...> wrote:
          > >
          > > > --- Nikolai Weibull <now@...> wrote:
          > >
          > > > > I figured that it was easier to add items to a cluster using
          > > > > containedin= for a syntax definition I'm writing, but it seems that
          > > > > one can't do it that way. Is there a reason for this, or is it an
          > > > > oversight? Can we add this to the todo? I've never needed it before,
          > > > > but for this particular grammar, it made a lot of sense.
          > >
          > > > Using 'syn keyword SomeKeyword foo containedin=@SomeCluster' does not add
          > > SomeKeyword to the cluster @SomeCluster, rather, it allows SomeKeyword be
          > > contained in all the items in @SomeCluster.
          > >
          > > Ah, of course. How silly of me. Although, it would be nice if this
          > > could be done somehow. A pair of @'s, perhaps, e.g., syn match
          > > Something containedin=@@Cluster '...'?
          >
          > Probably better if it was 'addto=@cluster' rather than complicating the
          > containedin option. If you are in the habit of spanning syntax commands across
          > multiple lines, then it's pretty easy to make a new line to add the item to the
          > cluster. I.e., if you have:
          >
          > syn match foo /foo/ contained
          > \ addto=@myCluster
          >
          > then it could be
          >
          > syn match foo /foo/ contained
          > syn cluster myCluster add=foo
          >
          > It's not so painful.

          Yes, it is, because many of the foo need to be added to two clusters,
          and it clutters up an already rather (unavoidably) cluttered syntax
          definition. Addto would perhaps make more sense.

          nikolai
        Your message has been successfully submitted and would be delivered to recipients shortly.