Community
    • Login

    Set Text Color

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    2 Posts 2 Posters 2.9k 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.
    • Faris AhmedF
      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
        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
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors