Releases: thatsIch/sublime-rainmeter
Color Picker Package Fix
Build against: 3126
Requires at least: 3092
Package control usually delivers the software with the .sublime-package
suffix, which is just a fancy zip
. Though through the zip files can not be accessed as from the file system.
I solved this by checking upon start if the user has file in
%appdata%/Sublime Text 3/Packages/User/Rainmeter/color/picker
called ColorPicker_win.exe
. If the user has not this file in there, the file is streamed there. If the user has an version not up to date, then the file is replaced. From that location on, the color picker can be called.
I should have realized this sooner, since this was the same problem with the yaml, through the workaround for the yaml files was a lot easier. Sorry for the inconvenience 🙇
Section Completion on Double Newline
Build against: 3126
Requires at least: 3092
In general people tend to write code very densely like
[MeasureInput]
Measure=Plugin
Plugin=InputText
SolidColor=75A0E8FF
FontColor=255,255,255,128
FontColor=55,255,255,128
FontFace=Seqoe UI
StringStyle=Italic
FontSize=#FontSize#
X=5
Y=5
H=25
W=240
DefaultValue="Change Me!"
Command1=!WriteKeyValue Variables FirstVar "$UserInput$" "#CURRENTPATH#InputText.inc"
Command2=!Refresh #CURRENTCONFIG#
Command3=!SetVariable SecondVar "$UserInput$" Y=40 DefaultValue="Change Me Too!"
Command4=["$UserInput$"] Y=75 DefaultValue="Text file path and name"
but there is also the option to seperate logical blocks like fonts, type, user interation etc.:
[MeasureInput]
Measure=Plugin
Plugin=InputText
SolidColor=75A0E8FF
FontColor=255,255,255,128
FontColor=55,255,255,128
FontFace=Seqoe UI
StringStyle=Italic
FontSize=#FontSize#
X=5
Y=5
H=25
W=240
DefaultValue="Change Me!"
Command1=!WriteKeyValue Variables FirstVar "$UserInput$" "#CURRENTPATH#InputText.inc"
Command2=!Refresh #CURRENTCONFIG#
Command3=!SetVariable SecondVar "$UserInput$" Y=40 DefaultValue="Change Me Too!"
Command4=["$UserInput$"] Y=75 DefaultValue="Text file path and name"
With that in mind you can now easily start a new section by having two newlines:
- I started by completing the
[Rainmeter]
section - because it was directly in the section, you get the default auto completion
- after hitting two newlines you get new section completion
- with tab you can easily switch to the next entry
Note: in Rainmeter you can override sections with the same name (though they are supposed to be unique). A common use-case is using @Include
option to override your local [Variables]
section (see docs). Thus you will get all possible options for the auto completion. Though I guess having them all in the same file makes little sense.
Color Picker Integration
Build against: 3126
Requires at least: 3092
This is a small quality of life improvement release:
I added context menu and main menu access to the color picker in case people do not want to use the keyboard:
Context Menu: Right-Click in a Rainmeter file > Pick Color...
Main Menu: Tools > Rainmeter > Pick Color...
The context menu is only available in Rainmeter files. The access in the main menu is only disabled no Rainmeter file is edited.
Color Picker
Build against: 3126
Requires at least: 3092
I fixed the integration with the color picker.
The default keybinding for the color picker ctrl+shift+c.
It worked by selecting the area like this:
which makes it really inconvenient. I changed the behaviour where only the caret needs to be inside of the color. So that it could be either |75A0E8FF
or 75A0|E8FF
or 75A0E8FF|
and it would still trigger the color picker.
The color picker also supported multiple OS which makes in case of Rainmeter little sense. I think only 4 people installed it on Linux and OSX and probably just by accident. I removed that and replaced the default windows color picker with a shipped one.
It has better UI and additionally supports alpha-channel editing. Basic color picking is also supported where you do not have to replace any existing color, but just execute it to get your color.
I also added some convenient conversions for the colors:
Alpha Detection:
If you change the color, it automatically detects if you already had an alpha channel and thus uses that information. But if you had no alpha channel and changed the alpha value in the color picker, it will be added.
Example:
FF0000
->FFFF00
changed color, had no alpha-channel, alpha-channel was truncatedFF0000
->FF000080
had no alpha-channel, added alpha-channelFF000080
->FFFF0080
changed color, had alpha-channel, alpha-channel stays
Hex Detection:
If you like to write in the Rainmeter color Format RRR,GGG,BBB,AAA
then the new color picker respects that.
Fixup release, because I forgot to push -.-
Syntax Highlight Fix
Build against: 3126
Requires at least: 3092
Due to legacy convertion I noticed a bug in the syntax, that some =
are highlighted and some are not. I figured it had to do with this "small" expression:
(?i)^\\s*(Program|Parameter|State|OutputFile|OutputType|StartInFolder|Background|BackgroundMode|BackgroundMargins|AccurateText|DefaultUpdateDivider|ImageCrop|Greyscale|Image(Name|Tint|Flip|Rotate|Alpha|Crop)|UseExifOrientation|SolidColor(2)?|GradientAngle|beveltype|Blur|BlurRegion([2-9]{1,1}|[0-9]{2,})?|Update|TransitionUpdate|Skin(Width|Height)|DragMargins|OnRefreshAction|OnCloseAction|On(Un)?FocusAction|OnChangeAction|OnUpdateAction|OnWakeAction|Author|Description|AppVersion|LocalFont([2-9]{1,1}|[0-9]{2,})?|DynamicVariables|Name|Information|Version|License|Group|Measure|InvertMeasure|Disabled|UpdateDivider|StartValue|EndValue|Increment|LoopCount|(Max|Min)Value|AverageSize|Action|ActionList([0-9])+|IgnoreWarnings|If(Above|Equal|Below)(Value|Action)|IfCondition([2-9]{1,1}|[0-9]{2,})?|If(True|False)Action([2-9]{1,1}|[0-9]{2,})?|IfMatch([2-9]{1,1}|[0-9]{2,})?|If(Not)?MatchAction([2-9]{1,1}|[0-9]{2,})?|Substitute|Formula|UpdateRandom|UniqueRandom|(Low|High)Bound|Processor|Drive|Total|Label|Type|IgnoreRemovable|DiskQuota|Net(In|Out|Total)Speed|Traffic(Action|Value)|Interface|Cumulative|Plugin|Reg(HKey|Key|Value)|ScriptFile|Format|TimeZone|TimeStamp|TimeStampFormat|TimeStampLocale|FormatLocale|DaylightSavingTime|AddDaysToHours|SecondsValue|Meter|X|Y|W|H|MeterStyle|Shape([2-9]{1,1}|[0-9]{2,})?|Inline(Pattern|Setting)(.*)?|MeasureName([2-9]{1,1}|[0-9]{2,})?|Hidden|AntiAlias|ToolTip(Text|Title|Icon|Type|Width|Hidden)|TransformationMatrix|Padding|Paused|Bar(Color|Image|Border)|(Primary|Secondary|Both)?ColorMatrix[12345]|BarOrientation|Flip|Bitmap(Image|Frames|TransitionFrames|ZeroFrame|Extend|Digits|Align|Separation)|Button(Image|Command)|SecondaryMeasureName|(Primary|Both|Secondary)(Color|Image(Crop|Tint|Flip|Rotate|Alpha)?|Greyscale)|(Primary|Both|Secondary)?ImagePath|Graph(Start|Orientation)|PreserveAspectRatio|ScaleMargins|Tile|MaskImageName|MaskImagePath|MaskImageFlip|MaskImageRotate|Line(Count|Width|Length|Start)|LineColor([2-9]{1,1}|[0-9]{2,})?|Scale([2-9]{1,1}|[0-9]{2,})?|HorizontalLine(s|Color)|Offset(X|Y)|(Start|Rotation)Angle|ValueRemainder|Control(Length|Start|Angle)|(Length|Start)Shift|Solid|Font(Color|Size|EffectColor|Face)|String(Align|Style|Effect|Case|)?|(Pre|Post)Fix|Autoscale|Percentual|NumOfDecimals|Text|ClipString(W|H)?|Angle|(Left|Right|Middle|(X(1|2)))Mouse(Down|Up|DoubleClick)Action|Mouse(Over|Leave)Action|MouseScroll(Down|Up|Left|Right)Action|MouseActionCursor(Name)?|CPUInclude|CPUExclude|TopProcess|CoreTemp(Type|Index)|Folder|InfoType|RegExpFilter|Include(SubFolders|(Hidden|System)Files)|Command[0-9]*|DefaultValue|Password|FocusDismiss|DefaultArtwork|Player(Name|Type|Path)|TrackChangeAction|DisableLeadingZero|PerfMon(Object|Counter|Instance|Difference)|DestAddress|UpdateRate|Timeout(Value)?|PowerState|ProcessName|PathName|Separator|Subfolders|FileFilter|RecycleType|ResCountType|SpeedFan(Type|Number|Scale)|SysInfo(Type|Data)|VD(Manager|MeasureType|DesktopCount|On((De)?Activate|Change)|Desktop|Width|Height|RefreshOnUpdate)|Desktop(Name|Wallpaper)|Screenshot|Url|RegExp(Substitute)?|FinishAction|OnRegExpErrorAction|OnConnectErrorAction|OnDownloadErrorAction|StringIndex(2)?|DecodeCharacterReference|Debug|Debug2File|Download(File)?|ErrorString|ForceReload|LogSubstringErrors|ProxyServer|UserAgent|Header([2-9]{1,1}|[0-9]{2,})?|CodePage|WiFiInfoType|WiFiIntfID|WiFiListStyle|Window(Name|Class|Message)|Context(Title|Action)([2-9]{1,1}|[0-9]{2,})?|Recursive|Count|Show(DotDot|Folder|File|Hidden|System)|(Hide)?Extensions|Sort(Date)?Type|SortAscending|Port|ID|RMSAttack|RMSDecay|RMSGain|PeakAttack|PeakDecay|PeakGain|FFTSize|FFTOverlap|FFTAttack|FFTDecay|Bands|FreqMin|FreqMax|Sensitivity|Parent|Channel|Type|FFTIdx|BandIdx|WildcardSearch|Index|IgnoreCount|DateType|Icon(Path|Size))\\s*(=)
Being said, the first word was highlighted correctly, thus the second word was not captured correctly.
I fixed this using the correct number capture to determine the position of the equal sign.
Temporary Installation Fix with Package Control
Build against: 3126
Requires at least: 3092
Package Control is undoubtly the most useful extension for Sublime Text. Even though I already send them a pull request I tried to work hard to make updating this package a lot easier, since I knew that their process time is long.
I added a new section in the readme [1] to explain the installation.
This uses the underused feature of Package Control to add an own repository. I provided a file which can be added and thus you install and update the Rainmeter package automatically without using git or manual interaction.
€: It was pulled and thus the README was rewritten to install it via Package Control without adding my repository file.
[1] https://github.com/thatsIch/sublime-rainmeter#with-package-control-and-added-repository
Theme switcher
Build against: 3126
Requires at least: 3092
People already noticed that switching the themes only worked through the settings since Rainmeter uses a specialized theme due to more regions required than most other programming languages. But if you tried to switch the theme in the Color Scheme settings it did not affect Rainmeter in any way (which is intended).
Color Schemes are the theme displayed for default tabs which do not own a specialized theme thus generally all your other files take that theme. If you wanted to switch the Rainmeter theme, you had to type in the theme manually which is quite error prone.
First I extended the settings to tell you all possible meaningful defaults
//The color scheme to use for Rainmeter syntax.
"color_scheme": "Packages/Rainmeter/Monokai (Rainmeter).tmTheme",
// "color_scheme": "Packages/Rainmeter/Lachgummi Joghurt.tmTheme",
// "color_scheme": "Packages/Rainmeter/Nexus (Rainmeter).tmTheme",
// "color_scheme": "Packages/Rainmeter/RainLexer.tmTheme",
// "color_scheme": "Packages/Rainmeter/Rainmeter (Light).tmTheme",
But in addition to that I chose to use a way to show the current selected skin and a way to easily switch between them.
Last but not least I added more error messages if something has gone horribly wrong like if you did not even install Rainmeter before using this plugin.
Settings Bugfix
Build against: 3126
Requires at least: 3000
If you installed Sublime Text for the first time and are using the Rainmeter package, the settings are initialized with the wrong brackets. Settings are supposed to look like
{
"user_specific_setting": true,
}
but it looked like
[
"user_specific_setting": true,
]
As you see in the markup this is not a valid JSON expression. This is a bug introduced by 65376db. If you are already using your own fixed version, you do not need to ugprade for the moment.
Revision 2720 support
Path fixes
Build against: 3126
Requires at least: 3000
There were some nasty bugs introduced because I did not think about the python directory and file management while developing. If you zip the application up, it will not find the files anymore. Using the given os.path
library, this should not happen anymore. Though some modules could fail due to refactoring, I made them much more robust and they should not fail all modules anymore.