Skip to content

Double click and cursor navigation/selection should respect editor.wordSeparators #249736

Open
@motoschifo

Description

@motoschifo

In VSCode, the double-click selection does not respect the configured editor.wordSeparators.
I tested it on two environment: plain text with no extensions loaded and PHP editor with the PHP Intelephense extension.

I removed from the default settings.json editor.wordSeparators these characters: dollar sign, dash, quotes, double quotes, tick, equal, underline:

{
   "editor.wordSeparators": "~!@#%^&*()-+[{]}\\|;:,.<>/?"
}

This is a sample script:

const CONSTANT_VALUE = "some value";
self::$_instance = new self();

If I double click on word some, the selection expand to include opening double quotes "some, and the same does when double click on value including ending double quotes value".
The desired behaviour should select only text because I removed double quotes from `wordSeparators.
Please note that also on that web editor page, the selection is correct and when double click some it will not include the opening double quotes.

If I navigate or select text with keyboard (ctrl+right or ctrl+shift+right), after _VALUE the cursor will skip equal sign and opening double quotes and go directly to the end of "some text.
On that situation, the navigation to next word (usually ctrl+right shortcut) will stop at the end of word, not the beginning on the next word.
On all editors I use, commercial or free, the skip next word command will move to the begin of the next word, not to the last char of the same word. If this can be configured with that option, it will be great.
The desired behaviour should move or select up to the beginning or the next word, not including symbols defined on configuration.

Can these behaviours be changed with options or extensions?
My suggestion is to use the already defined and perfect named editor.wordSeparators variable and respect it on all cursor navigations and selections conditions.

I read many issues opened and closed, I hope this will not be a duplicate request.

NOTE:
I set this as a feature request, but in my situations this is considered as a bug because all other editors work in a different way.

Metadata

Metadata

Labels

editor-coreEditor basic functionalityfeature-requestRequest for new features or functionality

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions