Repository: vscode
Issue: Anchor Selection with Search and Replace not working correctly
Labels: editor-find,under-discussion

Type: <b>Bug</b>

Steps to reproduce the issue:

Note: I am using JAWS for Windows 2024 in this scenario.

1. Open Visual Studio Code.
2. Open a new file and add five lines to the file like so:

hello1
hello2
hello3
hello4
hello5

3. Move to the top of the file.
4. Press ctrl+k plus ctrl+b
5. Move to the third line, that being:

hello3

6. Move the cursor to the end of the line, just after the 3 and press ctrl+k plus ctrl+k to mark the end of selection.

Note: Do not do this but I know the selection is set  because if I press delete the three lines are removed.

7. Press ctrl+h.
8. Type "he" in the find box and "je" in the replace box.

9. Tab to search in selection checkbox, sorry that name may be off a bit here. Make sure to check it.

Note: The goal here is to restrict the search and replace within the highlighted content.

10. Execute the find and replace function and note the verbage spoken by the screen reader. It tells me no items found.

Results:

Often I get differing results. In the last time I did this I got the last line of the file replaced with the first hello lines remaining. Sufffice it to say things don't seem to be working here. Could this be a screen reader issue?



VS Code version: Code 1.90.0 (89de5a8d4d6205e5b11647eb6a74844ca23d2573, 2024-06-04T19:33:54.889Z)
OS version: Windows_NT x64 10.0.26120
Modes:

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|AMD Ryzen 5 Microsoft Surface (R) Edition (12 x 2196)|
|GPU Status|2d_canvas: enabled<br>canvas_oop_rasterization: enabled_on<br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: enabled<br>multiple_raster_threads: enabled_on<br>opengl: enabled_on<br>rasterization: enabled<br>raw_draw: disabled_off_ok<br>skia_graphite: disabled_off<br>video_decode: enabled<br>video_encode: enabled<br>vulkan: disabled_off<br>webgl: enabled<br>webgl2: enabled<br>webgpu: enabled|
|Load (avg)|undefined|
|Memory (System)|7.45GB (0.99GB free)|
|Process Argv|--crash-reporter-id 5a524437-3f52-4db4-af12-3ac13392aa4b|
|Screen Reader|yes|
|VM|0%|
</details><details><summary>Extensions (10)</summary>

Extension|Author (truncated)|Version
---|---|---
copilot|Git|1.200.0
copilot-chat|Git|0.16.0
vscode-pull-request-github|Git|0.88.1
black-formatter|ms-|2024.2.0
debugpy|ms-|2024.6.0
python|ms-|2024.8.0
vscode-pylance|ms-|2024.6.1
LiveServer|rit|5.7.9
gitdoc|vsl|0.1.0
zen-mode-on-startup|zen|0.0.1


</details><details>
<summary>A/B Experiments</summary>

```
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscorecescf:30445987
vscod805cf:30301675
binariesv615:30325510
vsaa593:30376534
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
2i9eh265:30646982
962ge761:30959799
pythongtdpath:30769146
welcomedialogc:30910334
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
pythontestfixt:30902429
pythonregdiag2:30936856
pythonmypyd1:30879173
pythoncet0:30885854
2e7ec940:31000449
pythontbext0:30879054
accentitlementsc:30995553
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
jchc7451:31067544
chatpanelt:31048053
dsvsc021:30996838
g316j359:31013175
pythoncenvpt:31062603
a69g1124:31058053
dvdeprecation:31068756
pythonprt:31056678
dwnewjupyter:31046869
26j00206:31048877

```

</details>

<!-- generated by issue reporter -->