Community
    • Login

    Theme creation: How to choose separate color for...

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 3 Posters 356 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.
    • Drawing with Jakob DamD
      Drawing with Jakob Dam
      last edited by

      I want the < and > to be colored separately from the tag inside.

      Example:
      <HTML>

      < and > could be grey and HTML could be… let’s just say screaming hot pink, as an example. But is that possible?

      EkopalypseE 1 Reply Last reply Reply Quote 0
      • EkopalypseE
        Ekopalypse @Drawing with Jakob Dam
        last edited by

        @drawing-with-jakob-dam

        No, afaik the lexer treats the tag as a whole.
        What you can do is use a plugin like EnhanceAnyLexer to bypass such limitation.

        Drawing with Jakob DamD 1 Reply Last reply Reply Quote 3
        • Drawing with Jakob DamD
          Drawing with Jakob Dam @Ekopalypse
          last edited by

          @ekopalypse Thanks a lot for the reply; you’re probably right.

          I just noticed that the JavaScript part of the XML has this entry:
          <WordsStyle name=“OPERATOR” styleID=“10” fgColor=“9F9D6D” bgColor=“3F3F3F” fontName=“” fontStyle=“0” fontSize=“” />

          And this does indeed change the < and > color separate from what’s between them - as they’re seen as operators, along with plus, minus etc. - so maybe a hack like that could work.

          I’ve tried to copy the line to the HTML section and given it a unique styleID, but it didn’t work.

          EkopalypseE PeterJonesP 2 Replies Last reply Reply Quote 0
          • EkopalypseE
            Ekopalypse @Drawing with Jakob Dam
            last edited by

            @drawing-with-jakob-dam

            The html lexer is a complex lexer that also handles js, php, vb …
            But from what I see and understand, it doesn’t have this token.
            I assume there is no easy way to work around this, sorry.

            1 Reply Last reply Reply Quote 2
            • PeterJonesP
              PeterJones @Drawing with Jakob Dam
              last edited by

              @drawing-with-jakob-dam said in Theme creation: How to choose separate color for...:

              I’ve tried to copy the line to the HTML section and given it a unique styleID, but it didn’t work.

              Unfortunately, you cannot just arbitrarily copy XML from one language’s settings to another. Well, you can, but it won’t do anything.

              Each language’s lexer has its own bit of code that decides what will and what won’t be syntax highlighted; it reads the XML configuration for that language, and on the StyleID’s that it recognizes, it applies the styling defined by that line of XML to the sequences that match what that lexer is coded to match for that StyleID… but if you define a StyleID that the lexer doesn’t recognize, it won’t do anything with that definition, because there is no line of code in the lexer that does anything with that StyleID.

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