microsoft / vscode

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

"Replace" and "Find in selection" #113799

Closed yuming1985 closed 2 years ago

yuming1985 commented 3 years ago

Issue Type: Bug

I think there is a bug about "Find in selection" of "Replace". The first time it works fine, after that an abnormal condition occurs. For example, after entering the replacement target and replacement text, select the text area that needs to be replaced, click "Find in Selection", and then click "Replace all" to perform the replacement perfectly. At this time, "Find in Selection" is in the highlighted state, and the dialog box does not disappear, which is normal. When I select another text area again and click "Find in Selection", it shows that all the text consistent with the replacement target in the entire document is selected, and it is not limited to the area I selected.

VS Code version: Code 1.52.1 (ea3859d4ba2f3e577a159bc91e3074c5d85c0523, 2020-12-16T16:34:46.910Z) OS version: Windows_NT x64 10.0.18363

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz (16 x 2304)| |GPU Status|2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|95.78GB (85.25GB free)| |Process Argv|--crash-reporter-id b95726f0-8970-48e5-952b-f94acb0be456| |Screen Reader|no| |VM|33%|
Extensions (2) Extension|Author (truncated)|Version ---|---|--- language-kuka-krl|d4n|1.8.1 pdf|tom|1.1.0
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 openlogontheside:30221877 python763:30178808 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 python504:30227505 vswsl492:30211401 wsl2prompt:30224612 pythonvsdeb440cf:30237828 unusedprompt:30224610 folderexplorercf:30224615 openfilemenu:30224647 pythonvsded773cf:30236630 pythonvspyt600cf:30239449 ```
vscodebot[bot] commented 3 years ago

(Experimental duplicate detection) Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

yuming1985 commented 3 years ago

"Find in Selection" is in the highlighted state ----> surrounded by blue boxes, when the wrong selection occurs on the second click, the color of the blue box will be darkened. Then click the left mouse button anywhere and this blue box will disappear and the "Find in Selection" function will work again, but it will still only work once!!!