Code wrapped? (no L-R scrolling)

Hello,

Is there an option to have the code wrapped and fully visible at page width, instead of having to scroll left and right to see it all?

(I had the same trouble at the old forum.)

Cheers!

We’re still working on some site settings, one of which is a module to make a button to copy code show up as part of the interface.

For now, you might want to check out one of the themes that “boxes” messages in more narrowly to see if that also wraps code text, though I suspect it will continue to push off the side of the screen for now.

Thank you for pointing this out. It’s on our list to work on.

1 Like

Hi @HanonO!

I’ve been away from the forum for a while. I now see that you have put the copy button. Thanks for this!

Is there also an option of having the code text wrapped, too? Copying it to a text editor and reading it there is an option, but sometimes you just want to quickly skim through a forum thread without including other applications.

Thanks for all the backend work!

Hey, Giannis! Actually @Dannii I believe was the person who got the forum plugin for copyable text working right.

Unfortunately, the whole point of code display/copy feature tag is to show text as is. So if there are no actual line breaks in the text, they won’t show up here either and will push off the side of the screen.

Code text with no line breaks:

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

It’s up to the poster to break lines up when posting if that’s how they want it displayed. I went through and put manual carriage returns in the same passage below:

Lorem ipsum dolor sit amet, consectetur adipiscing elit, 
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi 
ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit 
in voluptate velit esse cillum dolore eu fugiat nulla pariatur. 
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia 
deserunt mollit anim id est laborum.

Putting these breaks in means when you copy the code, it will include the line breaks. Notice when I paste below, there are artificial line breaks in the second version. This may not work and destroy the whole reason for copy-paste if the code needs to be a continuous block.

Copied from first selection:

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

What copied from second selection:

Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi
ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit
in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia
deserunt mollit anim id est laborum.

If you are pasting a long passage that doesn’t need to be code/copyable text, you can also use the “insert scrollable content” from the gear icon in the message compose window. That will actually wrap text.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Unfortunately, as you see, code blocks with no line breaks will *still* not line break. Which is what you want with continuous code blocks.

If you can set a white-space: pre-wrap rule for code elements, it will preserve whitespace but wrap long lines without inserting hard line breaks.

On the other hand wrapping long code lines could make other more traditional languages look worse, but it might be a smaller problem than not wrapping I7 code.

3 Likes

Thanks @HanonO for the reply! I just think It would be nice to have the code look as close as possible to the Inform 7 IDE, which wraps it.

But I hear you. It’s not a big deal.

1 Like

I know it’s annoying if you’re just looking at the code and not intending to copy it, but if you have a side-scrolling feature on your mouse, you can slide a code window sideways to read what doesn’t wrap.

1 Like