News:

Wondering if this will always be free?  See why free is better.

Main Menu

Code posted in threads

Started by Fizzy, December 05, 2003, 05:09:24 AM

Previous topic - Next topic

Fizzy

Not sure if this is me and my browser but taking a look at

http://www.simplemachines.org/community/index.php?topic=1185

There is a line of code in code tags entered on the thread that is so long that the screen has doubled in width.
Is that a bug ? As in, should the code stretch off the screen like that ?
"Reality is merely an illusion, albeit a very persistent one." - A.E.


[Unknown]

Not a bug... code shouldn't really wrap anyway...

-[Unknown]

Fizzy

"Reality is merely an illusion, albeit a very persistent one." - A.E.


[Unknown]

Unless you really think it should...?

-[Unknown]

writeto

I should not. Think of the really long preg replace strings that have been created in the past. It would be 10x more complex to read if they wrapped.

Fizzy

No.

not a problem here guys.

I only posted about it baecause I thought it looked odd and that you might think that it was a problem.
If that's the way the forum is designed then it really isn't a problem for me, honestly :)
Just trying to do my little bit to help, that's all.
"Reality is merely an illusion, albeit a very persistent one." - A.E.


[Unknown]

I wanted to add scroll bars, but that would cause some problems with certain versions of IE it seems :(.

Maybe a theme can do it, or figure out a better way.

-[Unknown]

Aoshi

This is going back to the numbered lines, but I think it would fix this problem.

If the code to display line numbers was smart enough to know that certain lines were wrapped, then you'd be free to wrap lines and the readers would still know that they all belong on one line. I'm not too sure what you'd do for long lines of code that doesn't have spaces though.


I think it would be nice if you followed the example of some text editor that has lined numbers that supports word-wrap.

[Unknown]

Okay, this is getting annoying.  I'm going to say this once more.

In the css for the .code class, the "white-space" property has been added with a value of "pre" - this has much the same effect as "nowrap" but ALSO allows tabs to be used in the code section.

However, because it is similar to nowrap, it also adds the effect that, well obviously, lines are NOT automatically wrapped, as they usually would be by your browser.  When I investigated the possibilty of adding scrollbars to the box, I found that this only had the effect of screwing things up in Internet Explorer, despite how well it worked in Mozilla Firebird.

Adding line numbers would hardly solve the problem, and adding actual hard returns would not improve the situation either.  In my personal opinion, it is better this way because lines should bot be broken.  I always turn word wrapping off in those text editors you speak of.

So, to recap: will line numbering help?  No.  Is there any point in manually wrapping the lines like a text editor might?  No.

How can you change it?  Just DON'T have the "white-space" property in your .code class set to "pre" or "nowrap".

-[Unknown]

Aoshi

Ah, sorry for having you to repeat yourself. I must have missed your note about the pre and tabs and things screwing up in IE trying to improve on the code box.

To be honest, I also turn off word-wrap in those text editors, but that's because to me editing it and reading through it is different. I find horizontal scrollbars annoying when I'm simply browsing a thread with code in the middle. I'd personally rather have the code wrap when I'm just reading it, but I guess that's just my personal preference which I can just change on my boards.

[Unknown]

Happy?  I kludged it with javascript.

-[Unknown]

SparkieGeek

Quote from: [Unknown] on December 14, 2003, 08:20:58 AM
Happy?  I kludged it with javascript.

-[Unknown]

:'(

This thread now crashes my browser! (Win XP, Firebird 0.7)

I'm guessing that it's to do with the JS code, although it could be something else.

FB just hangs and takes 100% CPU, the page appears partly rendered..

[Unknown]

#12
But... Mozilla doesn't USE the javascript code. (because it can bother itself to render it properly with just the css.)

I'm sorta inclined now to think this is a bug in Firebird... happens to me too, but only that topic.

-[Unknown]

pulpitfire

#13
something unusual happened also when I was posting code in a topic.  the text is:

<? include("http://www.pege.net/index.php?action=news;board=36"); ?>

But no matter what I do, it always inserts a ";" after 36"

<? include("http://www.pege.net/index.php?action=news;board=36";); ?>

see:

http://www.simplemachines.org/community/index.php?topic=3623

Edit: even here in this thread, it keeps inserting ";" after 36", no matter what I do.

[Unknown]


Advertisement: