Is there a way of making a Textarea NOT wrap? [SOLVED]

Get help using Construct 2

Post » Mon Feb 13, 2017 12:08 pm

I've added a scripting language to a project, so naturally dropped a Text area in for debugging and quickly throwing scripts around. The parser can output errors, and give me line numbers for those errors in the script. However, with wrapping on it's awkward to work out line numbers. I think I've exhausted styling options with CSS, as wrapping is traditionally handled from the HTML end of things apparently.

So there we have it: does anyone know how to disable wrapping on a Textarea? :D

[ Edit: An alternative question, as this is the longer way I see of getting line numbers:
How can I specify a width for a textarea in characters, ie: columns? I know this can be specified in HTML, and should be specifyable by setting the CSS 'width' property to '40em' or whatever. Setting the width works, but even with all padding etc specifically set to 0, the width is waaaay over the specified value. ]

[Edit 2: Solved. It turns out if you set the CSS 'white-space' to 'nowrap' it works. I actually discovered this by being told it didn't work, and trying it anyway - which just goes to show... something.]
The LEVEL GENERATOR TOOLKIT



24 functions dedicated to producing randomly generated terrain for all kinds of games.
B
25
S
7
Posts: 247
Reputation: 2,318

Post » Mon Feb 13, 2017 5:29 pm

white-space: pre might be a better alternative, otherwise some browser might not preserve the white-space info.
B
75
S
31
G
27
Posts: 1,012
Reputation: 20,759

Post » Wed Feb 15, 2017 11:38 am

Oh! :) The white-space is significant, thank you for the heads-up! After I solved the problem yesterday my scripts started to get a little longer, and I'd like to add line numbers proper now. Any ideas?
The LEVEL GENERATOR TOOLKIT



24 functions dedicated to producing randomly generated terrain for all kinds of games.
B
25
S
7
Posts: 247
Reputation: 2,318


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 4 guests