Community
    • 登入

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

    已排程 已置頂 已鎖定 已移動 Help wanted · · · – – – · · ·
    2 貼文 2 Posters 276 瀏覽
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • A
      All Rfriends
      最後由 編輯

      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 條回覆 最後回覆 回覆 引用 0
      • PeterJonesP
        PeterJones @All Rfriends
        最後由 編輯

        @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 條回覆 最後回覆 回覆 引用 2
        • 第一個貼文
          最後的貼文
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors