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
I've been using the paste and go extension for years. Why don't they expose more prefs in the preferences panel ?
--b
>>> 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?
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?
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
> 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.
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.
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.
I would say
if url, convert newline to null
else, convert newline to space
would be a dandy default.
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.
So, um, why is the value "3" instead of "1" or "true"?
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
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?
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.
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!
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'.