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 465 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.
    • stmavS Offline
      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 Offline
        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

        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