Page 1 of 1

Rainmeter Lexer

Posted: 16.12.2025 17:21
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 35 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 35 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:

Re: Rainmeter Lexer

Posted: 16.12.2025 18:03
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]

Re: Rainmeter Lexer

Posted: 16.12.2025 18:19
by main Alexey
3. can you show the proper hilite of that long Rainmeter line, in other editors (which do it right)?

Re: Rainmeter Lexer

Posted: 17.12.2025 10:41
by sl23
1. That's great thank you.

Tbh, number 2 isn't too much of an issue, and on second thought maybe better as is! If the text contained within a nested variable could be coloured the same, ie, leaving the brackets and hash symbols as they are, that in itself would aid in spotting variables more easily. If you need more understanding of what they are, here's the page in the Rainmeter Manual.