UDL comment line style : long dash ( – ) symbol
I’m trying to use the long dash ( – ) symbol. (copy from MS WORD – )
The style doesn’t work. How can I fix it?
A short dash - works.
Weird. In the comment open/close,
–does not work. I just tried some experiments: For a UTF8-encoded file,
–works as a keyword, but not as folding or comment or operator or delimiter.
However, if you change your file to ANSI encoding (because
–is a character in Win-1252, which for the US is the default “ANSI” character set), then it will work in any of those slots.
This is because the UDL was defined with ANSI encoding in mind, and despite years of requests to update the UDL lexer to allow any unicode character and/or to follow the encoding of the current file instead of assuming ANSI-only, that feature has never been added to UDL.
So, you can “fix” it by encoding your file as ANSI. But that’s an evil fix.
I believe you can use any properly encoded character in the Enhance Any Lexer plugin. Yep, it recognizes
–properly. Install that plugin, and do a section that’s named after your active udl (use a section header of
[aaa4]in your example), and define a
color = regexpair – for example,
0x0000FF = –.*?–will make everything from – to – show up red when aaa4 UDL is active. (Enhance Any Lexer doesn’t do background colors, but if you want it to change only the foreground, that will work for you)
Thanks for the hint, I think the EnhanceAnyLexer plugin is what I need and it will help. It would be better to improve UDL and include any UTF character or even emoji there, and even better its own regex rules.