67

In Windows, it seems the default behavior when double-clicking a word is to select the word, and any whitespace following the word (spaces or tabs). You can see this behavior across all programs, so I'm assuming this isn't a per-program setting. This may be common to other operating systems, but I don't know from personal experience.

Is this something that can be configured in the OS anywhere or is it something I just have to live with?

Doozer Blake
  • 805
  • 2
  • 7
  • 7
  • 27
    Isn't that a stupid feature. – MVCylon May 12 '11 at 12:58
  • 23
    Ugh, I hate this so much, yes. (And I hardly ever use the mouse for text navigation and I /still/ hate it!) – Shinrai May 12 '11 at 14:21
  • 5
    This is so annoying. Have been using linux/mac for a long time and now that I am back to Windows, I remember what a pain this was. While I am trashing on Win, let me also add that I hate how preferences for every app is hidden in a different menu, unlike in Mac where the settings are always in the main app menu and has a fixed shortcut too which almost all the apps respect. – Harsh Jul 23 '20 at 06:30
  • 3
    It's like they designed this "feature" with the sole purpose of frustrating users. – Scott Greenfield Jun 22 '22 at 13:22

10 Answers10

40

I double click on the word, but hold the second click and drag it slightly. For some reason selecting multiple whole words (double-click and drag) doesn't select the whitespace afterwards, so you can double-click and drag just the one word.

Joe Teague
  • 501
  • 4
  • 4
  • I think this is the best solution... * Single word: Double-click and drag slightly left to de-select the trailing space * Multiple words: Double-click first word then drag to right to select additional words without trailing spaces – Brian Adkins Mar 14 '19 at 13:43
  • I cannot replicate this solution in Word 2019. – vic Feb 24 '20 at 19:13
  • 4
    Unfortunately **this solution does not work in most of the applications in Windows 10 2004**. I tested it in Notepad, Word 365, Firefox 82, My Phone (there the selection by words does not work at all!). The solution worked as described in Chrome and Edge browsers 86. On the other hand double click in Notepad++ or VS Code does not select the trailing whitespace. --- Anyway I did not know the trick for selection by words using the unfinished double click. – pabouk - Ukraine stay strong Nov 12 '20 at 08:34
  • How do you find this? – Ziyuan May 03 '23 at 21:47
31

A quick way to select a word without the trailing space

  1. Double-click a word.
  2. Without releasing the mouse button after the second click, move the mouse a tiny bit to the left.
  3. Release.

Tested on Windows 10 (build 17758).

demo animation

27

As far as I am aware, this is the default behaviour.

What I often do is to double-click the word and then hold shift and press the left arrow key (application allowing). I have found this to be the quickest method rather than attempting to precisely select the word under scrutiny with the mouse which is often a little tricky and fiddly.

SnookerFan
  • 1,114
  • 6
  • 19
  • 33
7

Simplest method for me: double click first selects word with following space, then hold shift and single click on same word (or click on any another word to extend selection). This selects word(s) without space.

user286725
  • 87
  • 1
  • 1
  • 1
    Where does this work?  It doesn’t work in Notepad, WordPad, Internet Explorer or Microsoft Word. – Scott - Слава Україні Aug 26 '18 at 15:05
  • 1
    Works in Chrome on Windows 10 21H1 – wilkas Nov 11 '21 at 03:35
  • Clarification for MS Word: Single-click at the position where you want the selection to end, not just anywhere in the word. The first command creates a selection, and the second command reduces the span of that selection. You can achieve the same results by entering SHIFT+LEFT ARROW as your second step. – Christopher Harwood Sep 16 '22 at 16:50
6

Easiest way to do this is double click, but do not release the mouse button on the second click. Then drag up (or down) slightly while still holding the mouse button down. You now will only have the word selected without a space on the end.

Joe
  • 69
  • 1
  • 2
  • 3
    You should say where this works, because it isn't system-wide. For example, this works in Chromium browsers. – Michael R Feb 13 '21 at 20:30
6

This behavior makes some amount of sense on word processors; when you want to delete, or cut, or move a word, you often want to include the space after the word; at least, that's the justification behind it. But it makes no sense whatsoever on read-only content, most especially on browsers. Since there isn't a system-wide solution, browsers are what I will focus on.


Firefox

This is easy to fix in Firefox: it has the layout.word_select.eat_space_to_next_word setting. Go to about:config, search for this setting and set it to false.


Chrome / other Chromium browsers / Electron apps

Unfortunately, there isn't an easy fix for Chrome and other Chromium browsers. The trick mentioned in three previous answers (double click, but on the second click, move the cursor slightly) generally works in Chromium browsers. My problem with that was:

  1. you need to do it every time if you never want the trailing space
  2. It works with clicking mouse buttons or clicking touchpad buttons, but not with "tapping" touchpad, as double tapping and moving on touchpad would simulate click and drag instead.

To help with 1., wrote the following workaround on AutoHotkey:

#If WinActive("ahk_class Chrome_WidgetWin_1")
  ~LButton::
    if (A_TimeSincePriorHotkey < 400) and (A_TimeSincePriorHotkey <> -1)
      MouseMove, 1, 0, 0, R
    return
#If

If you double click (i.e. within 400 ms) on a Chromium browser, it moves the cursor by one pixel before you release the mouse key, so that only the word is selected.

This works fine if you use a mouse, or if you actually forcefully click twice on the touchpad (or buttons if it has those). But it doesn't work well if you double tap on the touchpad. Presumably this is because, when you first tap the touchpad, it doesn't immediately send the click to the system, as it doesn't yet know if you actually want to click or do something else, e.g. double tap and move, which means click and drag. So if you actually double tap, it sends both clicks at the end of the second tap as a single event, so AutoHotkey can't interfere. (However, it works if you double tap slowly enough that the first tap is sent as a click by itself, but quickly enough that the second tap/click still counts as double click; but it's tricky to get it right.)

So I modified it as follows:

#If WinActive("ahk_class Chrome_WidgetWin_1")
  ~LButton::
    if (A_TimeSincePriorHotkey < 400) and (A_TimeSincePriorHotkey <> -1)
    {
      MouseMove, 3, 0, 0, R
      MouseClick
      MouseClickDrag, Left, 0, 0, -1, 0, 0, R
    }
    return
#If

So I scrap the first double click since I can't interfere with it, and redo the double click with the mentioned trick. The first mouse move is to prevent those new clicks to be interpreted as triple/quadruple clicks which would select the whole paragraph. It turns out that at least a 3-pixel move is necessary for that. So make sure not to click at the right edge of the word!

Triple click to select paragraph still works fine with this. However, double-click-and-drag to select multiple whole words, or triple-click-and-drag to select multiple whole paragraphs doesn't, since that is that feature that we utilize to select a single word. But if you occasionally use those features as well, it is possible to add an item to AutoHotkey menu to disable this specific workaround whenever needed.

This workaround works in all Chromium browsers, as well as Electron apps that inherit the same text selection from Chromium (I tested on Whatsapp), since they all have the ahk_class Chrome_WidgetWin_1. If you just want it to work on a browser or a specific app, it is possible to do that by changing the if statement, e.g. #If WinActive("ahk_exe vivaldi.exe") in my case, as I use Vivaldi.


AutoHotkey is quite flexible, and you could use it for a system-wide solution that works outside browsers and Electron apps. E.g. whenever you double click anywhere (detected with the same method as above), AutoHotkey can check if a trailing space is included in the selection, and send Shift + Left Arrow if it does. I didn't bother, as browsers were where this behavior annoyed me the most.

Debie Downer
  • 536
  • 6
  • 8
4

Single click after the last character of the word and press CTRL + SHIFT + LEFT ARROW

MVCylon
  • 473
  • 9
  • 17
2

On my Windows 10 PC I had assigned a macro to my middle mouse button to take off the last character from the selection and then copy it to the clipboard.

The macro from the MS Mouse & Keyboard Center looks like this: copy without trailing space macro

Paul B
  • 21
  • 2
0

Specifically within Microsoft Word, you can adjust this behaviour:

First, go to File > Options > Advanced > Cut, Copy and Paste.

Then, either:

  • Turn off Smart Cut and Paste
  • Or, in Smart Cut and Paste > Settings, turn off "Adjust sentence and word spacing automatically"
Steev43230
  • 71
  • 3
0

What is strange about this "feature" is that if you apply an attribute to the selected text (bold, underline, italic, font, etc.) it gets applied to the text only and not to the following space. On the other hand, if you delete the word, the space goes too.

On the third hand, if you manually select the word and the following space (i.e not by double-clicking), and then apply an attribute, it will be applied to the following space as well.

In other words, double-clicking and manually selecting look like the same selection (word + following space), but the behavior is different.

I can understand the logic in this, but it still annoys me. For years I've been unnecessarily removing the following space from double-clicked word selections (shift-left arrow) before applying font attributes. Now I'm trying to train myself to stop doing that, since it makes no difference, but old habits die hard.

YossiD
  • 21
  • 1