It is currently March 28th, 2024, 11:29 am

Sublime Text 2 Rainmeter package

Plugins and Addons popular with the Community
Post Reply
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: [WIP] Sublime Text 2 Rainmeter package

Post by MerlinTheRed »

Now hosted on GitHub: https://github.com/merlinthered/sublime-rainmeter

Will add a shiny description with images as soon as I have time. Also looking into making it available to install via Package Control so installing and Updating will be very easy.

New features on GitHub version:
  • Color Picker (ctrl+shift+c while cursor is in a hex color definition)
  • Added "New Skin" command to "Tools" menu
  • Added new color schemes (and removed the current one which I didn't really like). If you want to define what color scheme you want to use, copy Rainmeter.sublime-settings to your User directory and change the path to the color scheme you want.
  • Added snippets for plugins
  • More stuff that I forgot
For installing read the readme on the github page: https://github.com/merlinthered/sublime-rainmeter#readme
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am
Contact:

Re: [WIP] Sublime Text 2 Rainmeter package

Post by Kaelri »

I'm really glad that you've put this on GitHub. :) I was already planning to make an alternative color scheme for Nexus, and this will make things easier.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [WIP] Sublime Text 2 Rainmeter package

Post by jsmorley »

Minor nit..

ToolTipIcon=#ImagePath#Info.ico

That is showing up with a red "error" background, when it is perfectly valid and works.

UserVariables.inc
ImagePath=#@#Images\

Skin:
@Include="#@#UserVariables.inc"
...
ToolTipIcon=#ImagePath#Info.ico
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [WIP] Sublime Text 2 Rainmeter package

Post by jsmorley »

Another minor nit:


[MeterTopProcessPercent]
Meter=STRING
MeasureName=MeasureTopProcess%
...
Text=[%1%]

It coloring [%1%] as if it was a Variable Other Dynamic (basically I think it sees it as an embedded section being used in a dynamic way), when it isn't. It is just text with the %1 from MeasureName= embedded in it.

Might be pretty hard to tell the difference... ;-)
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: [WIP] Sublime Text 2 Rainmeter package

Post by MerlinTheRed »

Thanks for all those hints. That's exactly the kind of feedback I was looking for! It's pretty hard to tell what exactly is valid and what isn't by just reading the documentation ;)

ToolTipIcon: I overlooked the possibility to use a custom icon. I'll probably just remove the correctness checking for this type since it's not just a predefined number of strings or combinations of variables. Thinking about that, BarOrientation=#Orientation#al would also be a valid string. Damn, I need to over-think this whole error checking stuff. I have to look at how RainLexer does it.

As for coloring [%1%]: What if there is a measure that is called [%1%]? Is that a valid name? All I could tell is that measure names mustn't contain spaces. Currently I'm also trying to filter out bangs or !Execute-type stuff in square brackets by looking if there is a backslash, exclamation mark or quotes in there. I guess the only really reliable way would be to scan the document and all includes for defined measures (and meters in case of section variables) and only color usages of these. I don't know If I want to do that though, since it isn't possible with regular expressions, so I'd need a plugin that parses the code just like Rainmeter itself does...

Another possibility would be not to color stuff in square brackets at all.
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: [WIP] Sublime Text 2 Rainmeter package

Post by MerlinTheRed »

Kaelri wrote:I'm really glad that you've put this on GitHub. :) I was already planning to make an alternative color scheme for Nexus, and this will make things easier.
I couldn't take a look at the whole color scheme from just the one screenshot, but the colors look similar to one of the new themes I included: Lachgummi Joghurt.tmTheme.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [WIP] Sublime Text 2 Rainmeter package

Post by jsmorley »

MerlinTheRed wrote: ToolTipIcon: I overlooked the possibility to use a custom icon. I'll probably just remove the correctness checking for this type since it's not just a predefined number of strings or combinations of variables. Thinking about that, BarOrientation=#Orientation#al would also be a valid string. Damn, I need to over-think this whole error checking stuff. I have to look at how RainLexer does it.
Yeah, I would tend to lean toward only error checking keyword mistakes and typos on things like:

FontAlign=Left
StringAlign=Cneter

and the "deprecated" flagging you are doing with things like !Execute. I think you will struggle to get much else reliable as there are just so many valid ways to do things.
As for coloring [%1%]: What if there is a measure that is called [%1%]? Is that a valid name? All I could tell is that measure names mustn't contain spaces. Currently I'm also trying to filter out bangs or !Execute-type stuff in square brackets by looking if there is a backslash, exclamation mark or quotes in there. I guess the only really reliable way would be to scan the document and all includes for defined measures (and meters in case of section variables) and only color usages of these. I don't know If I want to do that though, since it isn't possible with regular expressions, so I'd need a plugin that parses the code just like Rainmeter itself does...

Another possibility would be not to color stuff in square brackets at all.
I sorta like having measures embedded in options and bangs highlighted, so it might be worth living with odd behavior the very rare times that someone uses square brackets in a Text= or something.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [WIP] Sublime Text 2 Rainmeter package

Post by jsmorley »

By the way, just a heads up. ST2 has a bit of a bug in the way it opens files, probably due to some "command line options" it supports, so that in Rainmeter, if you try to edit a skin from the context menu or Manage, it will fail if the user account name in Windows has a space in it.

What happens with my SkinPath of C:\Users\Jeffrey Morley\Documents\Rainmeter\Skins\ is that when I edit a skin it actually opens two new empty files of C:\Users\Jeffrey and C:\Morley\Documents\Rainmeter\Skins\MySkin.ini.

We are currently looking at how we can fix this from the Rainmeter side without causing any issues for other editors.

Just wanted to get this out there in case you get some feedback about it from someone.
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: Sublime Text 2 Rainmeter package

Post by MerlinTheRed »

Updated first post with shiny images and descriptive text.
User avatar
KreAch3R
Posts: 608
Joined: February 7th, 2011, 7:27 pm
Location: Thessaloniki, GR

Re: Sublime Text 2 Rainmeter package

Post by KreAch3R »

Amazing work, Merlin. And you found the program when, 10 days ago? Just amazing.
Post Reply