This has been upsetting me for a few months now, but now I think I should make a topic on it.

Basically, if I have code tags with some text on them:


Code:

Hello World
How are you?


Spaces will be added in the end of each line.

This adds extra bytes to my code if I want to copy it, and it's too hard to remove each one of them.

And please don't reply:


Code:

for i in range(0,len(codeArrayLines)):
    if i[len(i)-1] == " ":
        i.pop(len(i)-1)


No idea if that works, but well don't just tell me a way of going round it, because I'd like it fixed a lot Smile
This doesn't happen to me. What browser and OS are you using?
merthsoft wrote:
This doesn't happen to me. What browser and OS are you using?


Chromium 12 on Linux Mint 11 64-bits
Ok, I reproduced it in Chrome. It doesn't just happen with code, though, it happens on any line.
The problem is the Prettify plugin that we added to colorize and syntax-highlight code. This is a known issue; you can even get certain bits of code to be triple-spaced. It's something I'm half-heartedly working on.
Copy it to any IDE or text editor worth a damn. Then use whatever feature it has to trim whitespace at the end of lines.

Boom, problem solved.
Kllrnohj wrote:
Copy it to any IDE or text editor worth a damn. Then use whatever feature it has to trim whitespace at the end of lines.

Boom, problem solved.


ephan wrote:
No idea if that works, but well don't just tell me a way of going round it, because I'd like it fixed a lot


Also in CODE Tags as Kerm mentioned, the space between lines is not always the same.

I prefer not to have colour highlighting but have scrollbars and fixed line-height and not have whitespaces after lines.[/quote]
Umm. You use a modern computer, which means that you have at least 100 GB of hard drive space, you could easily save the files as-is. If you are that worried about tacking on extra bytes to your code you shouldn't style your code. After all, those bytes at the beginning of the lines are pointless and just waste space. One other point, you could write a script/cron job to go through your ~/src/ directory and remove the extra spaces (every two minutes if you must <.<).
ephan wrote:
I prefer not to have colour highlighting but have scrollbars and fixed line-height and not have whitespaces after lines.
I can certainly appreciate that, but the color seems quite popular. If I could fix up the Javascript to handle unexpected or "broken" code better, things would look nicer line-spacing wise, but the scrollbar thing certainly deserves to be in the Site Suggestions thread somewhere, if you wouldn't mind.
As I see that you have already added this, I, personally, dislike them. It is a lot easier to just have it on one page than to have to deal with a scrollbar (that you can't really move without a mouse). If we have to keep them, I would like to have a button that reverts it back (for that one code box).

But, as long as C6M doesn't add that, I suppose I'm fine. Except when I get on at school and don't want to log in.
I hear your concerns, _player, but I'm inclined to feel that for the most part, this is going to be a positive thing. Gone are the days when massive code pastes create massive pages, or when long lines of TI-BASIC stretch my browser window to three monitors' worth of width. I still want to resolve the multi-spacing problem, though.
Eh I think differentiating between code that you want a scroll bar on and ones you do not would be a better option. As in having a [ code ] and a [ codebox ] such as many other sites so that the poster can specific if they want scroll bars or not.
That opens the doors for abuse, and at the very least confusion. Or use Chrome 13.0.782.41 Beta, I don't see any code scroll bars, even on my giant code block post in the "Minecraft, Anyone?" topic. Even if I did see them, I wouldn't mind.
comicIDIOT wrote:
That opens the doors for abuse, and at the very least confusion. Or use Chrome 13.0.782.41 Beta, I don't see any code scroll bars, even on my giant code block post in the "Minecraft, Anyone?" topic. Even if I did see them, I wouldn't mind.
I see a very nice-looking scrollbar on that. Does Chrome ignore max-height, then? Sad Also, I can't think of a circumstance when you would want a page stretched out with a massive code box.
If the code is just a bit longer than the standard code block then I could see it being of use to prevent it scrolling one line or similar. A better option would be to have them be hidable or have it be a user pref, though that does mean one more non standard phpbb column. Razz
I just don't like them because that means that when you are viewing a long thing of code, you can't just scroll the page, you know have to use a mouse and scroll a tiny, hard-to-move scrollbar by bits and pieces tosee what you want (for instance, 1,000 line block of code, and the tiniest movement moves 20 lines).
KermMartian wrote:
I see a very nice-looking scrollbar on that. Does Chrome ignore max-height, then? Sad Also, I can't think of a circumstance when you would want a page stretched out with a massive code box.


I'm not seeing any scroll bars in Firefox, either - do you have to be on a certain theme?
Your prettify.js may be cached a refresh may fix that.
TheStorm wrote:
Your prettify.js may be cached a refresh may fix that.


Kind of sounds like I don't want to refresh tbh :p
TheStorm wrote:
Your prettify.js may be cached a refresh may fix that.
Yeah, clearing the cache worked. Can't say it was prettify, I nuked my whole cache.

I don't usually look at the programming topics, so I'm not going to bother protesting the feature as it won't impact my viewing experience :/
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement