microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.53k stars 29.4k forks source link

Copy & Paste bug in VS Code #53918

Closed clovett closed 6 years ago

clovett commented 6 years ago

Issue Type: Bug

If I click on the mardown preview window, double click a word and extend the selection to include a bit more, then hit "Copy" it copies the entire line onto the clipboard rather than just the text I selected. If I select the text without using double click then it works fine.

VS Code version: Code 1.24.1 (24f62626b222e9a8313213fb64b10d741a326288, 2018-06-13T17:51:32.889Z) OS version: Windows_NT x64 10.0.17134

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz (8 x 3510)| |GPU Status|2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: disabled_software
video_decode: enabled
video_encode: enabled
vpx_decode: enabled
webgl: enabled
webgl2: enabled| |Memory (System)|31.95GB (21.80GB free)| |Process Argv|d:\Program Files\Microsoft VS Code\Code.exe .| |Screen Reader|no| |VM|0%|
Extensions (4) Extension|Author (truncated)|Version ---|---|--- githistory|don|0.4.1 python|ms-|2018.6.0 cpptools|ms-|0.17.6 vscode-arduino|vsc|0.2.17
mjbvz commented 6 years ago

Does this reproduce in the latest VS Code build with all extensions disabled?

lovettchris commented 6 years ago

Yes, I upgraded to 1.25, and it happens on this mardown paragraph:

Create your training and validation datasets

Before you retarget an existing neural network, you must create a training dataset and a validation dataset for the image classes you want to recognize. In this tutorial, you'll classify images of 10 common fruits, including apple, banana, blackberry, blueberry, cherry, grapes, lemon, lime, orange and raspberry.

View this in the markdown preview, and double click blueberry. You will see "blueberry" selected, but now copy and paste and you will see the entire paragraph get pasted, not just the selected word "blueberry".

mjbvz commented 6 years ago

This is by design but rather confusing. When you double click in the markdown preview, we change the focus to be on the paragraph in the corresponding markdown editor. The can be disabled by setting "markdown.preview.doubleClickToSwitchToEditor": false

With the editor is focused (but without a selection) cmd+c copies the entire line