Text selection with mouse - how to disable "snap to text"?


Trying to select only a part of the line, but since I start text selection with a double-click, it “snaps” to “as many as possible” characters.
This is counter-productive.
How can I tell atom.io to not behave that way?
I mean, double-clicking should apply “snapping” only on text. Leave the second (third, fourth etc’) brackets out.

Notice it happens only on the second an on.
The first one doesn’t do that. I guess it’s some code compares the previous char and decides if it should auto-select the next one.

Code (JS) in the video:

const capitalize = (text) => text.capitalize();

const printMyName = (options) => {
// 1. Double-click on capitalize
// 2. Drap the mouse to the right, trying to select everything
// inside of console.log(…)
// No success, because there’s a “snap-to-text” to the last bracket

// Trying with SHIFT clicking… But it snaps!

Thanks :slight_smile:

user: {
firstName: ‘Dan’

I’ve made a nice GIF showing what I mean:



Here’s your problem. Don’t double-click. One click will start the text selection.


Not a problem. I don’t need to try and point the cursor exactly between two characters. Double-clicking solves that.


You can double-click and then press shift-right to achieve what you want. Otherwise, I think you’re fighting a fundamental behavior and there’s no way to tweak it without changing Atom’s code.


I wish it was that simple. The thing is, sometimes there are a few brackets, i.e something like “)])))”.

I think I have an idea for Atom though:

Look, when I double click a words and then mark text/code, there’s some “snap” flag turning on.
How do I know about this flag?
Simple: I release the mouse button, leaving the code selected. Then I Shift+click on the rest of the code I wish to include in the selection, but, it behaves as above - selecting blocks of “similar text”, i.e selecting blocks of brackets (like the above mentioned “)])))”) etc’.

Check if the Ctrl key is pressed, when utilizing that “snap” flag in order to decide on the required behavior (either select per character or per block of “similar text”).
If Ctrl key is pressed, flip the behavior.

This proposed solution doesn’t affect any user and solves it to ones like myself which I’m sure exist but are just too busy debugging :slight_smile:


When I think about it, Ctrl might conflict with the excellent multi-cursor feature.
Maybe the Alt key?
Maybe check if CAP LOCK is on?
You get the idea.


By the way - excellent work on Atom in general! Much appreciated! :slight_smile:


I’m sure it could be implemented just fine. However, the best place to make a proposal is the GitHub repo, not here. Not all of the developers look at the forum, and those who do don’t do it every day. If you post on the repo, your post will definitely be seen, at least.