Rainmeter Lexer

All questions regarding lexer highlighting schemes are discussed here...
Post Reply
sl23
Posts: 176
Joined: 29.01.2013 10:04

Rainmeter Lexer

Post by sl23 »

If possible, would you be able to update these small inconsistency issues with the Rainmeter lexer:
1. INI files do not support end of line comments, ie, after a line of code, so could you make it that the highlighting is consistent after using something like this please:

Code: Select all

TransformationMatrix=(Cos(Rad([#[#CURRENTSECTION]])));(-1*Sin(Rad([#[#CURRENTSECTION]])));(Sin(Rad([#[#CURRENTSECTION]])));(Cos(Rad([#[#CURRENTSECTION]])));(([#CURRENTSECTION#:X]+15)-([#CURRENTSECTION#:X]+15)*Cos(Rad([#[#CURRENTSECTION]]))-([#CURRENTSECTION#:Y]+15)*Sin(Rad([#[#CURRENTSECTION]])));(([#CURRENTSECTION#:Y]+15)+([#CURRENTSECTION#:X]+15)*Sin(Rad([#[#CURRENTSECTION]]))-([#CURRENTSECTION#:Y]+15)*Cos(Rad([#[#CURRENTSECTION]])))

This is how it appears on my screen:
2025-12-16_5.11.23.jpg
In other words, the highlighting is changing to show as if it were a comment, but it is not a comment, it is code.
I think the semi-colon character ";" should keep it's Comment colour though. And comments should only be coloured if on their own line.
2. Variables are shown highlighted in any typical scenario, when typed like this:

Code: Select all

#CURRENTSECTION#
Appear this way:
2025-12-16_5.16.49.jpg
2025-12-16_5.16.49.jpg (1.94 KiB) Viewed 26 times
But when typed like this:

Code: Select all

[#BuiltInVariableName]
[#[#MeasureName]]
[#[#*AnyName*]]
nested in any form, they appear like this:
2025-12-16_5.18.51.jpg
2025-12-16_5.18.51.jpg (1.63 KiB) Viewed 26 times
It would be helpul if variables kept the same highlighting, though brackets should keep their colour rather than take on the variable colour if that is possible, for easier viewing.
Thanks Alexey! :mrgreen:
Live for an ideal and leave no place in the mind for anything else.
main Alexey
Posts: 2803
Joined: 25.08.2021 18:15

Re: Rainmeter Lexer

Post by main Alexey »

fixed lexer is in the Git yet: https://github.com/CudaText-addons/CudaText-lexers
when all will be Ok, I will update the lex in the Addons Manager.

1. I got the idea. comments must begin only after line-begin, maybe with spaces/tabs before ';'.
fixed.

I did not get the idea:
2a. which chars are allowed in 'AnyName' here: [#[#*AnyName*]]
word-chars? any non-spaces / non-square-brackets?
2b. I hiltied this as a variable: [#BuiltInVariableName], but how should I hilite this: [#[#MeasureName]]
it is also a single var?
why don't you use only 1 pair of brackets: [#MeasureName]
Last edited by main Alexey on 16.12.2025 21:41, edited 1 time in total.
main Alexey
Posts: 2803
Joined: 25.08.2021 18:15

Re: Rainmeter Lexer

Post by main Alexey »

3. can you show the proper hilite of that long Rainmeter line, in other editors (which do it right)?
Post Reply