Community
    • Login

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

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 414 Views 1 Watching
    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 Offline
      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.

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP Offline
        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

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors