Drag selection bug


#1

When dragging bottom-up, I’m often times seeing the left-most character erroneously selected. It seems this bug has been around for awhile now, e.g. https://discourse-cdn-sjc1.com/business6/uploads/github_atom/420/c4c7b503a9142197.gif

And my own document I made before running into the animated gif showing the bug back in 2014:

I drag-select all the time and am constantly having to fix curly braces that are missing. I will note that I recently switched to OSX and Atom from Windows and Sublime Text, so I’m not totally certain if this is a bug limited to three-finger dragging in OSX (which seems buggy) or a bug specific to Atom.

Best
Michael


#2

I downloaded Sublime Text 3 and attempted to reproduce this bug, but it seems to be Atom-specific.


#3

I’m not familiar with three-finger dragging on OS X. Can you explain what you’re referring to?


#4

It’s an accessibility feature available on the force touchpad. That said, I wouldn’t worry about three-finger-drag – after further investigation, this issue is reproducible with a mouse as well, so it does indeed seem to be an atom-specific selection bug.


#5

I can’t reproduce the behavior you’re describing using Atom v1.9.0-dev-c31ade9 on Mac OS X 10.11.4. Can you reproduce the issue in Safe Mode? To launch Safe Mode:

  1. Completely exit all instances of Atom
  2. Launch Atom with the command atom --safe

#6

It does still appear in safe mode:

Reproduce by doing the following one-ish step:

  1. Click once, then quickly again (double click) but holding the second click, dragging from the bottom of the selected section and ending to the right of the opening brace.

The bug appears to be related to how Atom handles the double click event where the second click is a drag.

A double click beyond the line selects the first “word”, which in this case is typically a collection of non-alpha characters. When combine with the drag, that select-word behavior is carried with the cursor to the line above and applying it there, when it should have simply been swallowed by the drag-selection (intersection).

This will repro every time if you double-click correctly. If you pause between clicks, it will not occur.


#7

I think that’s deliberate. Depending on the initial selection (“normal”, word or line), the drag-selection will select “normally”, expand over words or expand over lines.

I think it’s a nice feature, edit: but it’s also undocumented. Maybe someone could expand the Flight Manual to cover mouse selections as well.


#8

There is an open Issue here on double-click drag:

You may want to add your repro steps and subscribe for updates.


#9

Fixing this bug does not preclude that behavior, fortunately!

Sublime Text, for instance, considers the new-line character to be a word when in word-selection mode, avoiding the possibility of accidentally swallowing end-of-line words when unintentionally word-selecting.


#10

Thanks; I’ll do that!

Edit: