Andrei provides an excellent tip for Firefox users in Pasting Wrapped URLs:

Here's another Mozilla/Firefox tip: if you copy a URL wrapped over multiple lines from somewhere and try to paste it into the address bar, you will end up only with the first line of it. To fix it, go to about:config and change editor.singleLine.pasteNewlines setting to 3 or add:

user_pref("editor.singleLine.pasteNewlines", 3);

to your user.js file. Now all the line breaks will be removed upon pasting.

Excellent! I'd been looking for such a feature.

Posted by jzawodn at August 06, 2005 09:25 PM

Reader Comments
# B said:

I've been using the paste and go extension for years. Why don't they expose more prefs in the preferences panel ?

--b

on August 6, 2005 10:47 PM
# Holoken said:

>>> Why don't they expose more prefs in the preferences panel? <<<

The reasoning is that it confuses the poor simple-minded users, and the power users can always set what they want the hard way. GNOME also has been following the same principle recently. There is something to be said in favour of this approach, as well as against, e.g:

Pros:
- Easier to find and set the important and oft-used options
- Less potential for confusion for users

Cons:
- Obscure options may get neglected, for example no explanations of what they do (Firefox guilty unfortunately, though as always you can find extensions that partially remedy this)
- Hidden options don't get the benefits of a well-formed UI, e.g. instant validation of user-input settings, drag-n-drop , etc.


Posible Solutions:

- A separate "Advanced Settings" panel launched directly from a menu option
- An "Advanced Settings" tab on the standard prefs panel
- An omnipresent button in the prefs panel, which reveals options marked as advanced. Advantage: Related options can be set in-place rather than the user having to go somewhere else to do that.
- Anything else?


on August 7, 2005 02:36 AM
# Matthom said:

I have this issue with Google Maps. Whenever I paste an address, which is usually two lines, ie:

123 S. Main ST
Rockville, MD 55001

If I copy those two lines, Google Maps (in Firefox) will only paste the first line.

Will that change work for Google Maps too?

on August 7, 2005 04:23 AM
# Darkside said:

A comment in the original article asked what a setting of 2 does.

http://kb.mozillazine.org/Firefox_:_FAQs_:_About:config_Entries#Editor..2A

0: Paste content intact (include newlines)
1 (default): 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

on August 7, 2005 09:47 AM
# alex said:

Yah! I love Firefox!

on August 7, 2005 10:17 AM
# Mike said:

> Why don't they expose more prefs in the preferences panel

There's a plethora of settings accessible via "about:config" - I changed "editor.singleLine.pasteNewlines" there. There used to be an extension called "Things They Left Out" (can't seem to really find it anymore) which had all kinds of options - really just a window for some of the things in about:config.

on August 7, 2005 10:21 AM
# Pete Prodoehl said:

Finally!

Thanks for the tip...

on August 7, 2005 01:12 PM
# Dave Land said:

Matthom: Yes, but it does just what it says it does -- it *removes* all newlines in the pasted text, so you end up with this in the Google Maps address box:

123 S. Main STRockville, MD 55001

You have to add a space between "ST" and "Rockville", which is still better than having to go back and forth, cutting and pasting a line at a time.

on August 8, 2005 11:35 AM
# Miles Libbey said:

Sounds like the desired behavior is "if copied text begins with 'http://', 'www', or has words separated by "." (and no spaces), then remove newlines."

The use case posted by Dave Land is a great example of why this shouldn't be a UI option -- it's very difficult for a user to make a proper choice, because both behaviors are going to be wrong sometimes.

on August 8, 2005 12:08 PM
# Wonky said:

I would say

if url, convert newline to null
else, convert newline to space

would be a dandy default.

on August 9, 2005 02:15 PM
# Aristoteles Pagaltzis said:

Note that newlines are always preserved. If you go to the end of the line and hit [Del], it will remove the newline and you get the stuff from the following line – just like in any editor. The only difference to multiline edit boxes is that you can’t see the following lines of multiline text and have no indication that they exist – but they do.

on August 10, 2005 05:50 PM
# Joe Grossberg said:

So, um, why is the value "3" instead of "1" or "true"?

on August 10, 2005 07:03 PM
# Dylan James Wagner said:

using a "5" seems to replace newlines with a comma and a space... this seems to be the optimal for Google Maps addresses...

5 - comma and space
6 - just last line
7 - first line displays twice, and then the second, comma and space (thats very odd)
8 - appears to do the same as 5

on November 20, 2005 11:03 PM
# R Michael Harman said:

I don't know if this post is still getting looked at, but does anyone know if there's a dynamic way to cause the value of editor.singleLine.pasteNewlines to depend on what search is selected in Mycroft, or on what's at the left end of the Address Bar? Would it be possible to add a line of code to the googlemaps.src file to set this key, or add something more complicated than just the user_pref() call in the prefs file?

on February 3, 2006 10:08 AM
# R Michael Harman said:

PS: I don't know what Aristoteles Pagaltzis is talking about; when I set the key to 1, and paste a multiline entry, it does not preserve the second line; going to the end of the buffer and pressing forward or delete does not get me the second line.

on February 3, 2006 10:11 AM
# Mark Wood said:

Clearly this setting is overloaded: there should be separate settings for different contexts. Many would want "3" for the addressbar field but "2" in forms.

The argument that power users can always set it in about:config ignores what so many projects ignore: the power user has to know that the setting exists and what it is called. This requires that the designers actually *tell* us something once in a while. As a software designer myself, I understand how hard it is to put one's self in the user's position and write down everything that he needs to know, but it's part of doing the job well.

Meanwhile, my thanks to all who have contributed their knowledge on this thread -- it's really helpful!

on May 13, 2006 06:06 AM
# Philipp van Hüllen said:

To Aristoteles Pagaltzis/Michael Harman:

Aristoteles speaks about the setting of '0', which preserves the complete clipboard on paste. As mentioned earlier in the thread, '1' is the default, where the content is cut just before the first newline.
I think I remember that earlier Mozilla versions had '0' as default, not '1'.

on July 27, 2006 01:13 AM
Disclaimer: The opinions expressed here are mine and mine alone. My current, past, or previous employers are not responsible for what I write here, the comments left by others, or the photos I may share. If you have questions, please contact me. Also, I am not a journalist or reporter. Don't "pitch" me.

 

Privacy: I do not share or publish the email addresses or IP addresses of anyone posting a comment here without consent. However, I do reserve the right to remove comments that are spammy, off-topic, or otherwise unsuitable based on my comment policy. In a few cases, I may leave spammy comments but remove any URLs they contain.