Sublime Forum

Create "fake" new lines

#1

Hi there,

noob here :wink: I use sublime text 3 to create rainmeter skins; I would like to know if there’s a way to create “fake” new lines, I mean like using “enter” but the new line is only “visual” because the .ini files used by Rainmeter, do not allow breaks in the lines of code.

Exemple:

from a line like this (in the editor is just a single line)

MouseOverAction=[!CommandMeasure Transition “Stop 1”][!CommandMeasure Transition “Stop 2”][!CommandMeasure FadeAlpha “Stop 1”][!CommandMeasure FadeAlpha “Execute 1”]

to this

MouseOverAction=[!CommandMeasure Transition “Stop 1”]

[!CommandMeasure Transition “Stop 2”]

[!CommandMeasure FadeAlpha “Stop 1”]

[!CommandMeasure FadeAlpha “Execute 1”]

Thanks in advance!

0 Likes

#2

There’s no way to add fake newlines, though you can enable word wrap.

0 Likes

#3

hoo, that’s no good lol!
Anyway thank you for letting me know!

0 Likes

#4

Maybe using empty phantoms with layout block could work

0 Likes

#5

I admit my profound ignorance but I’ve no clue of what you’re talking about… May you try to explain what that means and how I can do it?

0 Likes

#6

I’m talking about a plugin feature: http://www.sublimetext.com/docs/api_reference.html#sublime.Phantom

I did a quick test and it seems to work. In the console I can type

  • view.add_phantom ('fakeline', view.sel()[0], '<br>', sublime.LAYOUT_BLOCK) and it adds a fake line
  • view.erase_phantoms ('fakeline') to remove all fake lines in the current view

Starting from that you can create a command for each action and bind a keys.to each

0 Likes

#7

LAYOUT_BLOCK always appear below the line. They don’t cause the line to break.

0 Likes

#8

Ah correct, did not read the question properly :stuck_out_tongue:

0 Likes

#9

Thank you very much for your kindness and patience, really appreciated!
Well, I’m guessing that in order to reach my goal it seems that maybe a completely new plugin must be created, something that react 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.
This is what I’ve been told in the Rainmeter forum…

0 Likes