Change:
. To verify the bugfix, check that in the newest version of the monaco editor the alignment is as expected. edit from <!-- Do Not Delete This! bugreporttemplate --<!-- Please read our Rules of Conduct: --<!-- Read our guide about submitting issues: --<!-- Search existing issues to avoid creating duplicates. --<!-- Test using the latest Insiders build to see if your issue has already been fixed: --<!-- Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. --<!-- Launch with to check. --Does this issue occur when all extensions are disabled?: Yes <!-- If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. --<!-- Issues caused by an extension need to be reported directly to the extension publisher. The 'Help Report Issue' dialog can assist with this. --VS Code Version: 1.89.1 (user setup) Commit: Date: 2024-05-07T05:13:33.891Z Electron: 28.2.8 ElectronBuildId: Chromium: 120.0.6099.291 18.18.2 V8: 12.0.267.19-electron.0 OS: Windows_NT x64 10.0. Searched existing issues by "compare vertical alignment" - no relevant results. Steps to Reproduce: files test2 and test1 them Fact wrong vertical alignment of identical rows after delete-add section ! Expected !
Thanks for sharing the input documents and the screenshot! Unfortunately, it is still not clear what this issue is about - I don't see a big difference in the screenshots. Can you add more details?
difference (expected empty range) is shown on this picture !
Ahh, I see. Can you check the dev console?
No. I want fix in my test. Not in dev console. Can you reproduce my simple test in user interface?
No, I cannot reproduce. But I think VS Code might have logged some errors to the VS Code dev console. You could help me fixing this bug, but sharing if there are any error messages in the VS Code dev console.
Show your comparison result. Here is log from dev console: An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing. !

Discussion:
let lastModLineNumber = c.modified.startLineNumber; let lastOrigLineNumber = c.original.startLineNumber; <del> function emitAlignment(origLineNumberExclusive: number, modLineNumberExclusive: number) { </del> <ins> function emitAlignment(origLineNumberExclusive: number, modLineNumberExclusive: number, forceAlignment = false) { </ins> if (origLineNumberExclusive < lastOrigLineNumber || modLineNumberExclusive < lastModLineNumber) { return; } if (first) { first = false; <del> } else if (origLineNumberExclusive === lastOrigLineNumber || modLineNumberExclusive === lastModLineNumber) { </del> <ins> } else if (!forceAlignment && (origLineNumberExclusive === lastOrigLineNumber || modLineNumberExclusive === lastModLineNumber)) { // This causes a re-alignment of an already aligned line. // However, we don't care for the final alignment. </ins> return; } const originalRange = new LineRange(lastOrigLineNumber, origLineNumberExclusive);

} } <del> emitAlignment(c.original.endLineNumberExclusive, c.modified.endLineNumberExclusive); </del> <ins> emitAlignment(c.original.endLineNumberExclusive, c.modified.endLineNumberExclusive, true); </ins> lastOriginalLineNumber = c.original.endLineNumberExclusive; lastModifiedLineNumber = c.modified.endLineNumberExclusive;

} test(`test`, () => { <del> runTest('shifting-twice', 'advanced'); </del> <ins> runTest('issue-214049', 'advanced'); </ins> }); for (const folder of folders) {

<ins> hello world; // new line y </ins>  No newline at end of file

<ins> { "diffs": [ { "innerChanges": [ { "modifiedRange": "[1,13 -> 1,13 EOL]", "originalRange": "[1,13 -> 1,14 EOL]" }, { "modifiedRange": "[2,1 -> 3,1]", "originalRange": "[2,1 -> 2,1]" } ], "modifiedRange": "[1,3)", "originalRange": "[1,2)" } ], "modified": { "content": "hello world;n// new lineny", "fileName": "./2.txt" }, "original": { "content": "hello world; ny", "fileName": "./1.txt" } } </ins>

<ins> { "original": { "content": "hello world; ny", "fileName": "./1.txt" }, "modified": { "content": "hello world;n// new lineny", "fileName": "./2.txt" }, "diffs": [ { "originalRange": "[1,2)", "modifiedRange": "[1,3)", "innerChanges": null } ] } </ins>  No newline at end of file