Repository: vscode
Issue: Deleting lines when editor.linkedEditing is enabled leads to inconsistent results
Labels: bug,editor-synced-region


Type: <b>Bug</b>

enable the setting `editor.linkedEditing`, then in a svelte file (is where I notice it the most) delete the closing part of a html tag. For example:

1. Delete the last line of this text using a single action (for example, vim delete row)
```ts
<label class="something">
 <span>content</span>
</label>
```
Then, what you get is this:

```ts
< class="something">
 <span>content</span>
```

Whic does not recover when you try to paste the deleted closing label.

VS Code version: Code 1.90.1 (611f9bfce64f25108829dd295f54a6894e87339d, 2024-06-11T21:44:54.914Z)
OS version: Darwin arm64 22.6.0
Modes:

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

|Item|Value|
|---|---|
|CPUs|Apple M2 Pro (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)|2, 2, 2|
|Memory (System)|32.00GB (0.70GB free)|
|Process Argv|--crash-reporter-id 638386ec-d304-4548-864d-0259289f2c78|
|Screen Reader|no|
|VM|0%|
</details><details><summary>Extensions (29)</summary>

Extension|Author (truncated)|Version
---|---|---
vscode-neovim|asv|1.17.2
All-Autocomplete|Ati|0.0.26
file-browser|bod|0.2.11
vscode-tailwindcss|bra|0.10.5
catppuccin-vsc|Cat|3.14.0
catppuccin-vsc-icons|Cat|1.13.0
vscode-eslint|dba|3.0.10
gitlens|eam|15.1.0
EditorConfig|Edi|0.16.4
prettier-vscode|esb|10.4.0
copilot|Git|1.204.0
copilot-chat|Git|0.16.1
vscode-github-actions|git|0.26.3
vscode-pull-request-github|Git|0.90.0
open-in-vim|jon|0.7.0
playwright|ms-|1.1.7
vscode-data-preview|Ran|2.3.0
vscode-yaml|red|1.15.0
bash-beautify|sha|0.1.1
vscode-fileutils|sle|3.10.3
code-spell-checker|str|3.0.1
vscode-stylelint|sty|1.4.0
svelte-vscode|sve|108.5.1
even-better-toml|tam|0.19.2
ts-quickfixes-extension|tam|1.15.0
vscodeintellicode|Vis|1.3.1
pretty-ts-errors|Yoa|0.5.4
html-css-class-completion|Zig|1.20.0
vscode-open-in-github|ziy|1.3.6

(1 theme extensions excluded)

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

```
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstes627:30244334
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
h48ei257:31000450
pythontbext0:30879054
accentitlementst:30995554
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
jchc7451:31067544
chatpanelt:31048053
dsvsc021:30996838
jg8ic977:31013176
pythoncenvpt:31062603
a69g1124:31058053
dvdeprecation:31068756
pythonprt:31056678
dwnewjupyter:31046869
newcmakeconfigv2:31071590
legacy_priority:31077528

```

</details>

<!-- generated by issue reporter -->