Repository: vscode
Issue: Search pane: F4 after editing should visit the next search entry
Labels: bug,search,confirmed


Type: <b>Bug</b>

Current behavior:

- Press Ctrl+Shift+F to perform a search.
- Press F4 a few times.
- Edit the location of the search item. Notice that the active position in the search pane disappeared.
- Press F4. Editor location jumps to the first found item.

The behavior I expect:

- Press Ctrl+Shift+F to perform a search.
- Press F4 a few times.
- Edit the location of the search item, even to the point of it no longer matching the search term.
- Press F4. Editor location should jump to the search item that followed the previous search item while it still existed.

My impression is that the search pane loses selection on edits even if the edit does not make the selected entry disappear. But it would be great for my workflow to not lose the rough selection position among the search entries even if the selection would to disappear. The previous entry to the one that disappeared should become selected, so that the following F4 would find the next entry's position.

Non-issues: this issue is about navigating the search locations solely with F4 (or the corresponding command), not about what happens when someone presses Ctrl+Shift+F again etc.

VS Code version: Code 1.86.2 (903b1e9d8990623e3d7da1df3d33db3e42d80eda, 2024-02-13T19:40:56.878Z)
OS version: Windows_NT x64 10.0.22631
Modes:
Remote OS version: Linux x64 5.15.90.1-microsoft-standard-WSL2
Remote OS version: Linux x64 5.15.90.1-microsoft-standard-WSL2
Remote OS version: Linux x64 5.15.90.1-microsoft-standard-WSL2

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|12th Gen Intel(R) Core(TM) i5-12500H (16 x 3110)|
|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)|15.73GB (3.35GB free)|
|Process Argv|--crash-reporter-id 567907ee-4b0b-4e08-b1b4-a7074f51305a|
|Screen Reader|no|
|VM|0%|

|Item|Value|
|---|---|
|Remote|WSL: Ubuntu|
|OS|Linux x64 5.15.90.1-microsoft-standard-WSL2|
|CPUs|12th Gen Intel(R) Core(TM) i5-12500H (16 x 3110)|
|Memory (System)|7.63GB (6.05GB free)|
|VM|0%|

|Item|Value|
|---|---|
|Remote|WSL: Ubuntu|
|OS|Linux x64 5.15.90.1-microsoft-standard-WSL2|
|CPUs|12th Gen Intel(R) Core(TM) i5-12500H (16 x 3110)|
|Memory (System)|7.63GB (6.05GB free)|
|VM|0%|

|Item|Value|
|---|---|
|Remote|WSL: Ubuntu|
|OS|Linux x64 5.15.90.1-microsoft-standard-WSL2|
|CPUs|12th Gen Intel(R) Core(TM) i5-12500H (16 x 3110)|
|Memory (System)|7.63GB (6.05GB free)|
|VM|0%|
</details><details><summary>Extensions (19)</summary>

Extension|Author (truncated)|Version
---|---|---
tsl-problem-matcher|amo|0.6.2
find-and-transform|Art|5.0.1
clipboard-manager|Edg|1.5.0
pythonsnippets|frh|1.0.2
vscode-ptx-syntax|gka|1.0.0
better-cpp-syntax|jef|1.17.2
vsc-python-indent|Kev|1.18.0
jupyter-keymap|ms-|1.1.2
remote-containers|ms-|0.348.0
remote-wsl|ms-|0.86.0
gitlens|eam|14.8.2
vscode-pull-request-github|Git|0.80.1
navi-parens|luk|1.3.2
vocaml|luk|1.1.2
live-server|ms-|0.4.13
ocaml-platform|oca|1.17.1
r|REd|2.8.2
vscode-ocaml-expect-inline|rel|0.7.2
ocamlformat-auto-completion|tar|0.1.1

(1 theme extensions excluded)

</details><details>
<summary>A/B Experiments</summary>

```
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscoreces:30445986
vscod805cf:30301675
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:30899288
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythongtdpath:30769146
welcomedialog:30910333
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
pythontestfixt:30902429
pythonregdiag2:30936856
pyreplss1:30897532
pythonmypyd1:30879173
pythoncet0:30885854
pythontbext0:30879054
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
pydisww1:30959800
d34g3935:30971562
edj9j583:30969295
fegfb526:30961430
7j2b6412:30969109
e3gdj431:30958358

```

</details>

<!-- generated by issue reporter -->