• Login
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 231 Views
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 Nov 13, 2020, 4:49 PM

    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.

    P 1 Reply Last reply Nov 13, 2020, 4:58 PM Reply Quote 0
    • P
      PeterJones @All Rfriends
      last edited by Nov 13, 2020, 4:58 PM

      @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
      1 out of 2
      • First post
        1/2
        Last post
      The Community of users of the Notepad++ text editor.
      Powered by NodeBB | Contributors