Page 1 of 1

New line in text-box Gui element

Posted: Tue Dec 05, 2017 11:04 am
by Relik
Hi,

I am working on the mod Computer core and I have a problem with the element "text-box" :
"Copy / Past" function does not work well, which makes complex script development difficult (New lines are skipped)

I guess you're already aware of this problem, but I was wondering if there was a way to circumvent it (because I have not found a solution yet) ?
And if not, will this problem always be present with the new version of the Gui provided with the 0.17?

Re: New line in text-box Gui element

Posted: Fri Jan 19, 2018 9:15 pm
by pieppiep
I've found the same problem, have you found any workaround yet?
What I use for now is the on_gui_text_changed event and check if the length is more than 10 different compared to the previous change to detect a paste action.
When it's a paste action I do a event.element.text:gsub(' ', '\n') to replace every double space to a newline.
Unfortunately tabs are also changed to a space character, so nice code indentation gets lost and turned in extra newlines.

Re: New line in text-box Gui element

Posted: Fri Jan 26, 2018 11:25 am
by hreintke
Same issue at my side.

I am working on a "scriptable combinator" -> lua code into a text-box

Any solution available or other workaroud ?

Re: New line in text-box Gui element

Posted: Sun Mar 24, 2019 8:58 pm
by ownlyme
another issue is that after a few lines, the first line disappears, but only once.
(in 0.16)