Theme creation: How to choose separate color for...
-
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?
-
No, afaik the lexer treats the tag as a whole.
What you can do is use a plugin like EnhanceAnyLexer to bypass such limitation. -
@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.
-
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. -
@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.