Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    UDL to change font color of a character at a specific character count

    Help wanted · · · – – – · · ·
    2
    2
    29
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      All Rfriends last edited by

      I’m looking for a way to change the color of the character that falls at a specific character count on each line. For example, turn the 12th character on ever line red.

      PeterJones 1 Reply Last reply Reply Quote 0
      • PeterJones
        PeterJones @All Rfriends last edited by

        @All-Rfriends ,

        There’s nothing native to Notepad++ that does that out of the box.

        However, Notepad++ has plugins, including scripting languages.

        You can add extra highlighting to a builtin lexer (like the HTML lexer) or to a User Defined Language (UDL) using regexes via the script EnhanceAnyLexer.py that @Ekopalypse shares in his github repo.

        The regex would be something like (?-s)^.{11}\K(.) – I haven’t tried it, but that would be the first regex I would try = it finds first 11 characters .{11}, throws that out with \K, and then captures the single character (.). I believe that would do what you want.

        1 Reply Last reply Reply Quote 2
        • First post
          Last post
        Copyright © 2014 NodeBB Forums | Contributors