I'm trying to make a notes editor that uses Ctrl-Enter to make a line break when editing text with the InputText plugin. There is no problem working out when Ctrl-Enter has been used and using LUA to format the edited text for display in a string meter. The problem is that when it comes to editing it again using DefaultValue=#EditedText# the edited text won't show the line breaks.
I've tried EditedText="Line One#CRLF#Line Two#CRLF#Line Three" but this just displays as Line OneLine TwoLine Three in the InputText editing window. So what do I need to use so the InputText plugin displays it as though Ctrl-Enter had been used between each line?
Alternatively, does anyone know of a basic text editor written in LUA? I've seen lua-ed on https://github.com/martinwguy/lua-ed but have no idea what to do with those files to make them usable in the Rainmeter context.
It is currently April 18th, 2024, 10:47 am
Putting a Line Break in InputText's DefaultValue
-
- Posts: 1171
- Joined: January 22nd, 2011, 4:23 pm
- Location: GMT +8
-
- Posts: 1740
- Joined: November 13th, 2012, 9:53 pm
Re: Putting a Line Break in InputText's DefaultValue
i am just guessing as i can't try it right now.
maybe it is because the plugin interprets #CRLF#
how about trying something that it can't interpret likeinstead
maybe it is because the plugin interprets #CRLF#
how about trying something that it can't interpret like
Code: Select all
<br>
-
- Posts: 1740
- Joined: November 13th, 2012, 9:53 pm
Re: Putting a Line Break in InputText's DefaultValue
this would mean you'd have
and your lua script would have to format Ctrl-Enter and also <br>, maybe better even #CRLF# as well for both variables.
Code: Select all
EditedText="Line One#CRLF#Line Two#CRLF#Line Three"
;this is displayed as the result
PluginText="Line One<br>Line Two<br>Line Three"
;this is displayed while editing
-
- Posts: 1171
- Joined: January 22nd, 2011, 4:23 pm
- Location: GMT +8
Re: Putting a Line Break in InputText's DefaultValue
I've already have a LUA script that replaces the Ctrl-Enter used as a line break in the InputText editor with #CRLF# (or anything else) and then saves the edited text as a variable which can be used after a refresh (as the InputText plugin can't use dynamic variables).
The problem is that I don't want to have to edit text that has #CRLF# (or anything else) where I expect to see a line break.
What I need to know is how does the InputText plugin represent Ctrl-Enter so that it knows to use a line break and how can this be incorporated in a variable that is going to be passed to InputText as part of the DefaultValue.
The problem is that I don't want to have to edit text that has #CRLF# (or anything else) where I expect to see a line break.
What I need to know is how does the InputText plugin represent Ctrl-Enter so that it knows to use a line break and how can this be incorporated in a variable that is going to be passed to InputText as part of the DefaultValue.
-
- Posts: 1740
- Joined: November 13th, 2012, 9:53 pm
Re: Putting a Line Break in InputText's DefaultValue
you wont see a line break as the plugin displays all in one line.
so basically what you want would only be possible with a new version of the plugin.
Ctrl-Enter is displayed as one or two characters in that one line
http://en.wikipedia.org/wiki/Newline
as these control characters are "empty" you obviously can't see them.
so basically what you want would only be possible with a new version of the plugin.
Ctrl-Enter is displayed as one or two characters in that one line
http://en.wikipedia.org/wiki/Newline
as these control characters are "empty" you obviously can't see them.
-
- Posts: 1171
- Joined: January 22nd, 2011, 4:23 pm
- Location: GMT +8
Re: Putting a Line Break in InputText's DefaultValue
So I guess its time for a change in direction. I don't like the pop-up Notepad versions so maybe I'll try a stack of InputText lines (one for each note) that grows or shrinks as you add or delete lines.