I have an issue with double clicking and highlighting in VS Code (v 1.71.2).
Sometimes the double-click does not select the word double-clicked.
In this screen recording you can see the issue:
- Every time I used a double click.
- First time the word "Condition" was not selected, but the whole string literal.
- Then it was selected but the whole line was highlighted and when copying, only "Condition" would be pasted. That is correct.
The time that the word "Condition" was colored in fuchsia is the correct one but I want only that word to be highlighted instead of the entire string.
Anyone know the setting for this?
2
Answers
I concluded that the issue was that the string was highlighted due to the cursor being placed somewhere inside the string.
To disable this, I disabled the Occurrences Highlight ("editor.occurrencesHighlight": false)
By doing so, the editor did not highlight open/closing tags though. The (partial) solution to this was to install the extension Highlight Matching Tag
This issue was reported and fixed already, see:
Try to re-install the version
1.71.2
for release "August 2022 Recovery 2" and see if double-click selection works as expected.Note that different click-counts have different outcomes:
Configure word-separators with property
editor.wordSeparators
from preferences: Visual Studio Code—Customizing word separatorsSee also related: Double-click to select text does not always work · Issue #84319 · microsoft/vscode · GitHub.
To have finer control over selecting text you can use keyboard shortcuts like explained in Select all text between quotes in VS Code?.