Community
    • Login

    Need help with custom syntax highlighting for a simple example, struggling to understand how.

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    syntax highlight
    2 Posts 2 Posters 236 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.
    • stmavS
      stmav
      last edited by stmav

      Text file will look like this, each chat message appears on its own line:

      [2021/07/18 18:57] Mango: Hi how are you apricot?
      [2021/07/18 18:58] Apricot (meow123): Doing well thank you mango
      [2021/07/18 18:59] Apple (fruitfruit123): Hi guys how are you?

      How do I customize so I can have 3 different colors based on the syntaxing above? Basically I want:

      • The timestamp to be a light grey color
      • The username to be red, meaning “Mango” and “Apricot (meow123)” are usernames
      • The text messages (everything after the : in the username) to be black?

      Bonus points if it’s possible to insert spacing between the username and the chat messages!

      EkopalypseE 1 Reply Last reply Reply Quote 0
      • EkopalypseE
        Ekopalypse @stmav
        last edited by

        @stmav
        Sorry, but this is hardly possible with the built-in UDL since parts
        are dynamic and UDL does not provide regex terms to identify different parts.
        You have to write your own lexer for this case.
        A scripting plugin like PythonScript can be used to make this possible.
        If you are familiar with another programming language there may be ways to use it as well.

        1 Reply Last reply Reply Quote 2
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors