Repository: vscode
Issue: [folding] pasting over collapsed blocks leaves random lines collapsed
Labels: bug,editor-folding

Type: <b>Bug</b>

1. Copy a block of text:

            cspell:npm/dict/npm.txt
            cspell:filetypes/filetypes.txt
            cspell:typescript/dict/typescript.txt
            cspell:php/dict/php.txt
            cspell:fullstack/dict/fullstack.txt
            cspell:django/dict/django.txt
            cspell:aws/aws.txt
            cspell:node/dict/node.txt
            cspell:python/src/common/extra.txt

2. Open a [`yml`](https://github.com/check-spelling-sandbox/AnswerOverflow/blob/45e370d8797687c3671ff5873a61e5f2578b929b/.github/workflows/spelling.yml) file with nesting
3. Collapse some of the sections ([`comment-push`](https://github.com/check-spelling-sandbox/AnswerOverflow/blob/45e370d8797687c3671ff5873a61e5f2578b929b/.github/workflows/spelling.yml#L111-L126) and [`comment-pr`](https://github.com/check-spelling-sandbox/AnswerOverflow/blob/45e370d8797687c3671ff5873a61e5f2578b929b/.github/workflows/spelling.yml#L128-L145))
4. Paste the simple list

### Actual results

Some lines are collapsed


https://github.com/microsoft/vscode/assets/2119212/88351544-2849-431c-bb02-3bac54f24768



VS Code version: Code 1.90.0 (Universal) (89de5a8d4d6205e5b11647eb6a74844ca23d2573, 2024-06-04T19:34:44.157Z)
OS version: Darwin arm64 23.5.0
Modes:

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|Apple M1 Max (10 x 2400)|
|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>webgl: enabled<br>webgl2: enabled<br>webgpu: enabled|
|Load (avg)|4, 10, 9|
|Memory (System)|64.00GB (0.64GB free)|
|Process Argv|--crash-reporter-id 1fc67ee2-0174-4598-9f98-4537df0dd32c|
|Screen Reader|no|
|VM|0%|
</details><details><summary>Extensions (19)</summary>

Extension|Author (truncated)|Version
---|---|---
quitcontrol-vscode|art|4.0.0
asciidoctor-vscode|asc|3.2.3
yamlfmt|blu|0.1.4
vscode-intelephense-client|bme|1.10.4
open-in-macdown|Cod|1.0.0
intelli-php-vscode|DEV|0.12.15062
dhall-lang|dha|0.0.4
vscode-dhall-lsp-server|dha|0.0.4
EditorConfig|Edi|0.16.4
vscode-github-actions|git|0.26.3
vscode-pull-request-github|Git|0.88.1
go|gol|0.41.4
file-downloader|min|1.0.13
sarif-viewer|MS-|3.4.4
vscode-dhall-lsp-server|pan|0.0.4
vscode-xml|red|0.27.1
rst-vscode|tht|3.0.1
simple-rst|tro|1.5.4
vscode-maven|vsc|0.44.0


</details><details>
<summary>A/B Experiments</summary>

```
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256859
vscoreces:30445986
vscod805cf:30301675
binariesv615:30325510
vsaa593:30376534
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
vscrp:30673768
962ge761:30959799
pythongtdpath:30769146
welcomedialogc:30910334
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
pythontestfixt:30902429
pythonregdiag2:30936856
pythonmypyd1:30879173
h48ei257:31000450
pythontbext0:30879054
accentitlementst:30995554
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
jchc7451:31067544
chatpanelc:31048052
dsvsc021:30996838
945dj816:31013170
pythoncenvpt:31062603
a69g1124:31058053
dvdeprecation:31068756
pythonprt:31056678
dwnewjupytercf:31046870
newcmakeconfigv2:31071590

```

</details>

<!-- generated by issue reporter -->