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

[patch] Extend :highlight link command to take attributes

Expand Messages
  • So8res
    This allows you to ... It s the analog of the :syntax combine option. This makes things much easier on color scheme designers. As in the above example, they
    Message 1 of 4 , Dec 4, 2012
    • 0 Attachment
      This allows you to

      :highlight link BoldComment Comment cterm=bold

      It's the analog of the :syntax combine option.

      This makes things much easier on color scheme designers. As in the above example, they can create a base highlight group (Comment) and then link a number of related groups to it with minor modifications (BoldComment, etc.).

      If the user ever changes Comment's color, BoldComment's color changes too.

      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Ben Fritz
      ... This seems another useful feature, and since you still only have a single item defining highlighting for a given highlighted item in the text, this change
      Message 2 of 4 , Dec 4, 2012
      • 0 Attachment
        On Tuesday, December 4, 2012 11:20:02 AM UTC-6, So8res wrote:
        > This allows you to
        >
        > :highlight link BoldComment Comment cterm=bold
        >
        > It's the analog of the :syntax combine option.
        >
        > This makes things much easier on color scheme designers. As in the above example, they can create a base highlight group (Comment) and then link a number of related groups to it with minor modifications (BoldComment, etc.).
        >
        > If the user ever changes Comment's color, BoldComment's color changes too.

        This seems another useful feature, and since you still only have a single item defining highlighting for a given highlighted item in the text, this change shouldn't need any additions to the behavior synIDattr or synIDtrans. Unlike this, the :syntax combine change allows (if I understand correctly) potentially any number of items in the syntax stack to define highlighting for a single highlighted item in the text.

        --
        You received this message from the "vim_dev" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      • So8res
        ... I believe you re correct, though I haven t updated highlight_has_attr / highlight_color to correctly get the color (I only updated syn_id2attr and
        Message 3 of 4 , Dec 4, 2012
        • 0 Attachment
          > This seems another useful feature, and since you still only have a single item defining highlighting for a given highlighted item in the text, this change shouldn't need any additions to the behavior synIDattr or synIDtrans.

          I believe you're correct, though I haven't updated highlight_has_attr / highlight_color to correctly get the color (I only updated syn_id2attr and syn_id2color). I'll update the patch shortly.

          > Unlike this, the :syntax combine change allows (if I understand correctly) potentially any number of items in the syntax stack to define highlighting for a single highlighted item in the text.

          Correct. They're both really useful in their own right. This is useful for simplifying your color schemes, whereas syntax-combine is useful for nested syntaxes.

          I've got a third patch baking that will add the ability to turn terminal attributes off which will work both here and in syntax-combine.

          --
          You received this message from the "vim_dev" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
        • So8res
          Upon reconsideration, synIDtrans should return a list of IDs that are being used in the current highlight group. This includes all links that also have
          Message 4 of 4 , Dec 4, 2012
          • 0 Attachment
            Upon reconsideration, synIDtrans should return a list of IDs that are being used in the current highlight group. This includes all links that also have attributes & the top level group if any, skipping vanilla links.

            This is consistent with the behavior that syntax-combine should exhibit.

            Here's the patch updated with the synIDtrans fix.

            We might want to consider adding a "link" {what} to synIDattr, as it's now a bit harder to detect links.

            --
            You received this message from the "vim_dev" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php
          Your message has been successfully submitted and would be delivered to recipients shortly.