Mouse drag-select after double click expands selection (but shouldn't)


#1

Hi there. I’d like to report some apparently inconsistent behavior with double-click selection. It’s language-inspecific.

Behavior A (the intuitive & customary behavior):

  1. Drag-select some code or word. Do not use double-click.
  2. A couple lines away, do a different drag-select on a different word. The originally-selected code is deselected and a new selection begins. Pretty much what we’re used to without a modifier key. Good.

Now clear your selection, and try…

Behavior B (the eye-crossing behavior):

  1. Select the same word in code that you did in A(1) but use double-click this time.
  2. Try A(2), again using a drag-select. This time, Atom tries to expand your selection instead of starting a new one.

The two problems that I see with this are:

  • Behavior B is kind of exasperating & unnatural to be enabled by default without a keypress (e.g. Shift)
  • If we’re gonna have both behaviors, I think there should at least be a visual indication of which mode you’re in.

Regards,
Chris


Inconsistent behavior from double-click drag-select
#2

Is this a duplicate of this issue?


#3

Close, but not quite – but they might be related. (I did read that one before I posted.)

If I read it correctly, that issue seems to be more about how the drag-select incorporates text into its selection. My issue is more about the counter-intuitive behavior of continuing a selection in a different part of the code by default/when no modifier key is depressed.

Regards,
Chris


#4

@cpowell thanks for working this out - I’d seen the behaviour too (as have others (see some other discussions)) but no-one knows why it happens as the selection-expanding behaviour seemed to only happen sometimes. Now you’ve come up with the reproducible case we know.

:+1: