The truth about editor.singleLine.pasteNewlines

A while back, some where on the great wide Internet, I remembered reading about Firefox’s editor.singleLine.pasteNewlines setting. The advice was how to tweak it, so that if you ever had a long URL with line-breaks in the middle, e.g.:

You could just copy both lines, paste into Firefox, and the right thing would happen.

I.e., you’d get a working:

instead of a truncated

This happens a lot with long URLs in email, so sounds pretty handy, right?

I don’t remember where, but I distinctly remember reading the number value you set for it was the maximum number of line-breaks it would trim. The article recommended setting it to 3, so you’d get rid of up to 3 line-breaks.

Why 3, I wondered. Why not 4? If 3 is good, obviously 4 would be better!

This is America, baby! We go big!

So, being an American, I set mine to 4.

And it never worked.

Well it sorta did. It did remove the newlines. Only it replaced them with commas.

WTF!?!

Now, don’t get me wrong. I have nothing against commas. I like conjunctions, strings of adjectives, and prepositional phrases as much as the next guy. I just don’t like them in my URLs.

I was also a little confused about why people thought this setting was so great. After all, it clearly didn’t work. Yet, I would see it again and again and again in blog posts.

I figured it was one of two things: Either I had seriously whacked my install of Firefox somehow (which, as an Extension junkie, was quite possible) or there was a secret mass collusion out there & the entire Internet was fucking with me. I figured it was mostly the former, but I had to admit, there where times I thought it was the latter.

Anyway, bored, surfing the Internet & watching TV, I thought I’d look the setting up. So I did.

http://kb.mozillazine.org/About:config_entries

editor. singleLine. pasteNewlines
Determines the behavior when pasting content containing newlines into single-line text boxes.
0 (default in Linux): Paste content intact (include newlines)
1 (default everywhere else): Paste the content only up to (but not including) the first newline
2: Replace each newline with a space
3: Remove all newlines from content
4: Substitute commas for newlines in text box

Now, it seems to me that 3 would be the most logical default everywhere. After all, in 99% of the cases, that’s probably what the user wants to do.

I can understand 0 & 1. Well, not really. But I’ve been in enough geek flamewars to know the type of idoit logic that could result in them being seen as the preferable solution. Here I would imagine the argument to being it’s more important to do what the user literally stated (an invalid url with newlines) than what the probably meant (a valid url without newlines).

What I can’t see is how anyone ever made a case for option 4. The thing here is Firefox is open source. So not only did someone think it was a good idea, they managed to convince someone else it was a good idea too.

What I want to know is how that conversation went down.

“Listen boss, I’ve been thinking about this pasteNewlines thing.”

“Yeah?”

“Well, so far we options 0-3. But it was bugging me last night. We’re missing something. Then this morning, while taking a shower, I realized what it was.”

“Oh?”

“Commas.”

“Commas?”

“Commas. Instead of just providing variations on newlines, we should let the user have an option to replace them with commas.”

“Commas. I see it now. My boy, you’re a genius. Get this patch on the trunk asap!”

“Right away, sir!” Scurrying back to his desk.

“Checkmate, Mr. Gates. Checkmate, indeed.”

So, fine. I’m an idiot for not having used 3 like everyone else on the planet, but whoever came up with an option 4, you’re just as retarded as me.

4 Responses to “The truth about editor.singleLine.pasteNewlines

  1. Brian Says:

    Probably have the commas option for things like Google Maps

  2. Andy Says:

    Setting editor.singleLine.pasteNewlines to 4 is useful in Thunderbird and SeaMonkey if you want to paste a column of e-mail addresses into the the mail compose address box. If the e-mail addresses are comma-delimited, when you press the Enter key, they get separated onto individual lines. Really needs to be two separate preferences, one for mail and one for the browser.

  3. wdr1 Says:

    Ahh… now that actually makes sense, since they shared the same core. Thanks for pointing it out Andy, and I definitely agree with you that it should be two separate options.

  4. William Reardon’s Blog » Blog Archive » An Open Letter to the Thunderbird Team Says:

    […] wdr1 on The truth about editor.singleLine.pasteNewlines […]

Leave a Reply