Double-clicking to select text also selects blank spaces

Discussion of general topics about Mozilla Firefox
Post Reply
mastavic
Posts: 1090
Joined: March 28th, 2004, 12:18 am
Location: San Francisco/San Jose, California

Double-clicking to select text also selects blank spaces

Post by mastavic »

Hello.

When I double-click text to select (aka highlight) text, the blank spaces (aka white spaces) before and after the text also gets selected (aka trailing spaces are selected). How do I make it so only the text is selected?

The popular suggestion seems to be changing layout.word_select.eat_space_to_next_word to false, which does not work. I run across this issue at least several times a week, mostly because I double-click to select text from a chain of Gmail emails I receive regularly. When I use Chrome for those exact emails, the blank spaces are not selected.

This seems to be a bug that has persisted for nearly a decade. I remember asking about this in approximately 2011, and then got a bit frustrated due to lack of a fix. Because of this issue and a few other reasons, I started using Chrome as my primary browser and Firefox as my secondary. I am trying to return to having Firefox as my primary browser, but am running into bugs and issues I experienced years ago that I hope would have been fixed.

A search on Google shows dozens of other threads addressing this issue:
1) Bugzilla: Fix double-click selection behaviors from 05/13/2010: https://bugzilla.mozilla.org/show_bug.cgi?id=565734
2) ghacks.net: How To Copy Words Without Trailing Space In Firefox and Thunderbird from 03/23/2012: https://www.ghacks.net/2012/03/23/how-t ... underbird/
3) mozillaZine:Double click to select word without trailing spaces from 09/23/2016: http://forums.mozillazine.org/viewtopic ... &t=3023922
4) Mozilla Support: Copy adding extra space at beginning when double clicking to select text from 07/21/2014: https://support.mozilla.org/en-US/questions/1011667
kerft
Posts: 585
Joined: January 30th, 2019, 9:38 am

Re: Double-clicking to select text also selects blank spaces

Post by kerft »

For me, setting layout.word_select.eat_space_to_next_word to false fixes the problem with double-click. The word is selected without a space after (edit: on a typical page, however the testcases in the bugzilla bug 1232322 do function as they say clicking bar selects foo bar). The fix is instant, without needing to restart. After changing that setting, try Firefox safe mode to disable your extensions and see if there it works.

These other settings, for me, are at the default:
layout.word_select.stop_at_punctuation is true
layout.word_select.stop_at_underscore is false
Last edited by kerft on March 5th, 2019, 7:18 pm, edited 1 time in total.
User avatar
therube
Posts: 21714
Joined: March 10th, 2004, 9:59 pm
Location: Maryland USA

Re: Double-clicking to select text also selects blank spaces

Post by therube »

Examples where you see that behavior?

The popular suggestion seems to be changing layout.word_select.eat_space_to_next_word to false
Are you sure about that?
Seems to be the two [in SeaMonkey] (select.) prefs should be, 'true'.


Check out the test cases in this Bug 1232322 Double-clicking on a word can select two words.


(You may find this interesting, "Hidden text" being copied to the clipboard?)
Fire 750, bring back 250.
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball CopyURL+ FetchTextURL FlashGot NoScript
Post Reply