It is currently August 10th, 2020, 4:34 pm

Breaks in options

Help with creating, editing & fixing problems with skins
User avatar
deflore08
Posts: 29
Joined: July 12th, 2020, 7:47 am

Breaks in options

Post by deflore08 »

Hello! Is there any way to break a strings at options like mouseactions or ifConditions? For example, i have next code:

Code: Select all

 LeftMouseUpAction                = [!WriteKeyValue "Variables" "RGB_Color" " #Blue#" "#@#Colors.ini"][!WriteKeyValue "Variables" "Last_Global_Color" " #Blue#" "#@#Colors.ini"][!WriteKeyValue "Variables" "Last_BG_Color" " #Blue#" "#@#Colors.ini"][!SetVariable RGB_Color " #Blue#"][!SetVariable Last_Global_Color " #Blue#"][!SetVariable Last_BG_Color " #Blue#"][!WriteKeyValue "Variables" "Last_RGB_Font_Color" " #Blue_Text#" "#@#Colors.ini"][!WriteKeyValue "Variables" "Last_Font_Color" " #Blue_Text#" "#@#Colors.ini"][!WriteKeyValue "Variables" "Last_Warning_Color" " #Blue_Warning#" "#@#Colors.ini"][!WriteKeyValue "Variables" "Font_Color" " #Blue_Text#, #Font_Alpha#" "#@#Colors.ini"][!WriteKeyValue "Variables" "Font_Warning_Color" " #Blue_Warning#, #Font_Alpha#" "#@#Colors.ini"][!SetVariable Last_RGB_Font_Color " #Blue_Text#"][!SetVariable Last_Font_Color " #Blue_Text#"][!SetVariable Last_Warning_Color " #Blue_Warning#"][!SetVariable Last_Value_Color " #Blue_Value#"][!WriteKeyValue "Variables" "Font_Value_Color" " #Blue_Value#, #Font_Alpha#" "#@#Colors.ini"][!WriteKeyValue "Variables" "Last_Value_Color" " #Blue_Value#, #Font_Alpha#" "#@#Colors.ini"] #Values_Color_Renew#
It's reeeally complicated to manage this. I'd want to make it more readable, like:

Code: Select all

 LeftMouseUpAction                = [!WriteKeyValue "Variables" "RGB_Color" " #Blue#" "#@#Colors.ini"]
	[!WriteKeyValue "Variables" "Last_Global_Color" " #Blue#" "#@#Colors.ini"]
	[!WriteKeyValue "Variables" "Last_BG_Color" " #Blue#" "#@#Colors.ini"]
	[!SetVariable RGB_Color " #Blue#"]
	[!SetVariable Last_Global_Color " #Blue#"]
	[!SetVariable Last_BG_Color " #Blue#"]
	[!WriteKeyValue "Variables" "Last_RGB_Font_Color" " #Blue_Text#" "#@#Colors.ini"]
	[!WriteKeyValue "Variables" "Last_Font_Color" " #Blue_Text#" "#@#Colors.ini"]
	[!WriteKeyValue "Variables" "Last_Warning_Color" " #Blue_Warning#" "#@#Colors.ini"]
	[!WriteKeyValue "Variables" "Font_Color" " #Blue_Text#, #Font_Alpha#" "#@#Colors.ini"]
	[!WriteKeyValue "Variables" "Font_Warning_Color" " #Blue_Warning#, #Font_Alpha#" "#@#Colors.ini"]
	[!SetVariable Last_RGB_Font_Color " #Blue_Text#"]
	[!SetVariable Last_Font_Color " #Blue_Text#"]
	[!SetVariable Last_Warning_Color " #Blue_Warning#"]
	[!SetVariable Last_Value_Color " #Blue_Value#"]
	[!WriteKeyValue "Variables" "Font_Value_Color" " #Blue_Value#, #Font_Alpha#" "#@#Colors.ini"]
	[!WriteKeyValue "Variables" "Last_Value_Color" " #Blue_Value#, #Font_Alpha#" "#@#Colors.ini"]
 	#Values_Color_Renew#
But i don't know a way for this. Rainmeter don't accept these breaks. So.. I go crazy a bit with this one-string things. :(
Last edited by deflore08 on August 2nd, 2020, 1:00 am, edited 1 time in total.
User avatar
jsmorley
Developer
Posts: 21235
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Breaks in options

Post by jsmorley »

deflore08 wrote: August 2nd, 2020, 12:00 am Hello! Is there any way to break a strings at options like mouseactions or ifConditions? For example, i have next code:

Code: Select all

 LeftMouseUpAction                = [!WriteKeyValue "Variables" "RGB_Color" " #Blue#" "#@#Colors.ini"][!WriteKeyValue "Variables" "Last_Global_Color" " #Blue#" "#@#Colors.ini"][!WriteKeyValue "Variables" "Last_BG_Color" " #Blue#" "#@#Colors.ini"][!SetVariable RGB_Color " #Blue#"][!SetVariable Last_Global_Color " #Blue#"][!SetVariable Last_BG_Color " #Blue#"][!WriteKeyValue "Variables" "Last_RGB_Font_Color" " #Blue_Text#" "#@#Colors.ini"][!WriteKeyValue "Variables" "Last_Font_Color" " #Blue_Text#" "#@#Colors.ini"][!WriteKeyValue "Variables" "Last_Warning_Color" " #Blue_Warning#" "#@#Colors.ini"][!WriteKeyValue "Variables" "Font_Color" " #Blue_Text#, #Font_Alpha#" "#@#Colors.ini"][!WriteKeyValue "Variables" "Font_Warning_Color" " #Blue_Warning#, #Font_Alpha#" "#@#Colors.ini"][!SetVariable Last_RGB_Font_Color " #Blue_Text#"][!SetVariable Last_Font_Color " #Blue_Text#"][!SetVariable Last_Warning_Color " #Blue_Warning#"][!SetVariable Last_Value_Color " #Blue_Value#"][!WriteKeyValue "Variables" "Font_Value_Color" " #Blue_Value#, #Font_Alpha#" "#@#Colors.ini"][!WriteKeyValue "Variables" "Last_Value_Color" " #Blue_Value#, #Font_Alpha#" "#@#Colors.ini"] #Values_Color_Renew#
It's reeeally complicated to manage this. I'd want to make it more readable, like:

Code: Select all

 LeftMouseUpAction                = [!WriteKeyValue "Variables" "RGB_Color" " #Blue#" "#@#Colors.ini"]
	[!WriteKeyValue "Variables" "Last_Global_Color" " #Blue#" "#@#Colors.ini"]
	[!WriteKeyValue "Variables" "Last_BG_Color" " #Blue#" "#@#Colors.ini"]
	[!SetVariable RGB_Color " #Blue#"]
	[!SetVariable Last_Global_Color " #Blue#"]
	[!SetVariable Last_BG_Color " #Blue#"]
	[!WriteKeyValue "Variables" "Last_RGB_Font_Color" " #Blue_Text#" "#@#Colors.ini"]
	[!WriteKeyValue "Variables" "Last_Font_Color" " #Blue_Text#" "#@#Colors.ini"]
	[!WriteKeyValue "Variables" "Last_Warning_Color" " #Blue_Warning#" "#@#Colors.ini"]
	[!WriteKeyValue "Variables" "Font_Color" " #Blue_Text#, #Font_Alpha#" "#@#Colors.ini"]
	[!WriteKeyValue "Variables" "Font_Warning_Color" " #Blue_Warning#, #Font_Alpha#" "#@#Colors.ini"]
	[!SetVariable Last_RGB_Font_Color " #Blue_Text#"]
	[!SetVariable Last_Font_Color " #Blue_Text#"]
	[!SetVariable Last_Warning_Color " #Blue_Warning#"]
	[!SetVariable Last_Value_Color " #Blue_Value#"]
	[!WriteKeyValue "Variables" "Font_Value_Color" " #Blue_Value#, #Font_Alpha#" "#@#Colors.ini"]
	[!WriteKeyValue "Variables" "Last_Value_Color" " #Blue_Value#, #Font_Alpha#" "#@#Colors.ini"]
 	#Values_Color_Renew#
But i don't know a way for this. Rainmeter don't accept these breaks. So.. I go crazy a bit with this one-string things. :(
No, there is not. Breaks in lines is just not supported in the .INI file format.
User avatar
deflore08
Posts: 29
Joined: July 12th, 2020, 7:47 am

Re: Breaks in options

Post by deflore08 »

Thanks for info! Regretfully.. I've got to check then, maybe an some IDE can use a fake breaks.
User avatar
Lieuallen
Posts: 16
Joined: June 8th, 2020, 11:56 pm
Location: USA

Re: Breaks in options

Post by Lieuallen »

It's not the solution you were hoping for, but you could at least turn on "word wrap" in your code editor, so you wouldn't have to deal with one very long line that doesn't display.
"Imagination is more important than knowledge." -- Albert Einstein
User avatar
Yincognito
Posts: 2223
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Breaks in options

Post by Yincognito »

If only Notepad++ would have a plugin or a setting to treat Vertical Tab / Line Tabulation as a "fake newline" instead of displaying it as VT, that would solve the issue, as Rainmeter ignores it and runs the bangs after it...
User avatar
deflore08
Posts: 29
Joined: July 12th, 2020, 7:47 am

Re: Breaks in options

Post by deflore08 »

Lieuallen wrote: August 2nd, 2020, 11:27 am It's not the solution you were hoping for, but you could at least turn on "word wrap" in your code editor, so you wouldn't have to deal with one very long line that doesn't display.
Yes, word wrap helps a bit, i'd exactly suicide without it. But it's not a solution, because long code is unreadable. :)
Yincognito wrote: August 2nd, 2020, 1:11 pm If only Notepad++ would have a plugin or a setting to treat Vertical Tab / Line Tabulation as a "fake newline" instead of displaying it as VT, that would solve the issue, as Rainmeter ignores it and runs the bangs after it...
I think that's it. No clue how to use it in VS Code..
User avatar
Yincognito
Posts: 2223
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Breaks in options

Post by Yincognito »

deflore08 wrote: August 3rd, 2020, 2:27 pmI think that's it. No clue how to use it in VS Code..
Yeah, I was talking about using it in Rainmeter code, not VS code. The only thing missing is having Notepad++ (which is largely used to edit Rainmeter code, since it can do syntax highlighting through RainLexer) reacting to the vertical tab / line tabulation character by visually inserting a new line in the code. Since that wouldn't technically be a newline character but only produce a "new line" visual effect, it would allow Rainmeter to execute the bangs after it, just as if the bangs were one after another on the same line.

That would require someone to write such a line tabulation plugin for Notepad++, of course. I'm not sure if it's possible to change Notepad++'s behavior on such a low level, but maybe it is. Other software (I read somewhere that Microsoft Word does that...) use the line tabulation character to simulate a new line without actually using the newline character.