Community
    • Login

    Set Text Color

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    2 Posts 2 Posters 3.3k 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.
    • Faris AhmedF Offline
      Faris Ahmed
      last edited by

      Hi all,

      I have a simple and primitve text format like this:

      <Country:
      Name:Germany
      Population:82,000,000
      <BorderCountries:
      Country:Austria
      Country:Poland
      Country:Denmark

      TimeZone:+1
      Currency:Euro

      The format is very simple ‘<’ is the opening Tag, ‘>’ is the closing Tag, ‘:’ is the separator Tag between a node name and its value e.g. name:value

      In my .NET plugin, I want to set the color of the node names (like Name, Population, BorderCountries…etc.) and the values like ‘Germany’, ‘Austria’, ‘Poland’…etc.

      I do the text parsing and formatting in my plugin.

      How can I tell Notepad++ to set the color of specific text?

      I tried the UDL but couldn’t come up with a solution.

      Best regards,
      Faris Ahmed

      1 Reply Last reply Reply Quote 0
      • dailD Offline
        dail
        last edited by

        I do the text parsing and formatting in my plugin.

        So you mean are actually writing a custom lexer? If so then you might want to look at some other lexers people have created and see how they are doing it. In general a lexer assigns a style number to each character and then that style number has color/font/underline/bold/etc associated with it.

        I tried the UDL but couldn’t come up with a solution.

        I’ve never use UDL so I can’t be of any help here. :)

        1 Reply Last reply Reply Quote 1

        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