monaco-editor-core 0.54.0-dev-20250919 → 0.54.0-dev-20250921

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/esm/nls.messages.de.js +1 -1
  2. package/esm/nls.messages.es.js +1 -1
  3. package/esm/nls.messages.fr.js +1 -1
  4. package/esm/nls.messages.it.js +1 -1
  5. package/esm/nls.messages.ja.js +1 -1
  6. package/esm/nls.messages.ko.js +1 -1
  7. package/esm/nls.messages.ru.js +1 -1
  8. package/esm/nls.messages.zh-cn.js +1 -1
  9. package/esm/nls.messages.zh-tw.js +1 -1
  10. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.js +8 -8
  11. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.js.map +1 -1
  12. package/esm/vs/editor/browser/widget/diffEditor/diffEditorViewModel.js +3 -3
  13. package/esm/vs/editor/browser/widget/diffEditor/diffEditorViewModel.js.map +1 -1
  14. package/esm/vs/editor/browser/widget/diffEditor/diffEditorWidget.js +1 -1
  15. package/esm/vs/editor/browser/widget/diffEditor/diffEditorWidget.js.map +1 -1
  16. package/esm/vs/editor/browser/widget/diffEditor/features/gutterFeature.js +1 -1
  17. package/esm/vs/editor/browser/widget/diffEditor/features/gutterFeature.js.map +1 -1
  18. package/esm/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js +1 -1
  19. package/esm/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js.map +1 -1
  20. package/esm/vs/editor/common/core/ranges/lineRange.js.map +1 -1
  21. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +8 -8
  22. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js.map +1 -1
  23. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +5 -5
  24. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
  25. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +1 -1
  26. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js.map +1 -1
  27. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js +2 -2
  28. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js.map +1 -1
  29. package/esm/vs/editor/contrib/middleScroll/browser/middleScrollController.js +3 -3
  30. package/esm/vs/editor/contrib/middleScroll/browser/middleScrollController.js.map +1 -1
  31. package/package.json +2 -2
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.54.0-dev-20250919(1b33d5dced070e8e1b00f7b468693a5a780985bd)
3
+ * Version: 0.54.0-dev-20250921(1b33d5dced070e8e1b00f7b468693a5a780985bd)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.54.0-dev-20250919(1b33d5dced070e8e1b00f7b468693a5a780985bd)
3
+ * Version: 0.54.0-dev-20250921(1b33d5dced070e8e1b00f7b468693a5a780985bd)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.54.0-dev-20250919(1b33d5dced070e8e1b00f7b468693a5a780985bd)
3
+ * Version: 0.54.0-dev-20250921(1b33d5dced070e8e1b00f7b468693a5a780985bd)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.54.0-dev-20250919(1b33d5dced070e8e1b00f7b468693a5a780985bd)
3
+ * Version: 0.54.0-dev-20250921(1b33d5dced070e8e1b00f7b468693a5a780985bd)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.54.0-dev-20250919(1b33d5dced070e8e1b00f7b468693a5a780985bd)
3
+ * Version: 0.54.0-dev-20250921(1b33d5dced070e8e1b00f7b468693a5a780985bd)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.54.0-dev-20250919(1b33d5dced070e8e1b00f7b468693a5a780985bd)
3
+ * Version: 0.54.0-dev-20250921(1b33d5dced070e8e1b00f7b468693a5a780985bd)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.54.0-dev-20250919(1b33d5dced070e8e1b00f7b468693a5a780985bd)
3
+ * Version: 0.54.0-dev-20250921(1b33d5dced070e8e1b00f7b468693a5a780985bd)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.54.0-dev-20250919(1b33d5dced070e8e1b00f7b468693a5a780985bd)
3
+ * Version: 0.54.0-dev-20250921(1b33d5dced070e8e1b00f7b468693a5a780985bd)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.54.0-dev-20250919(1b33d5dced070e8e1b00f7b468693a5a780985bd)
3
+ * Version: 0.54.0-dev-20250921(1b33d5dced070e8e1b00f7b468693a5a780985bd)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -320,8 +320,8 @@ let DiffEditorViewZones = class DiffEditorViewZones extends Disposable {
320
320
  this._register(autorun(reader => {
321
321
  /** @description update scroll modified */
322
322
  const newScrollTopModified = this._originalScrollTop.read(reader)
323
- - (this._originalScrollOffsetAnimated.get() - this._modifiedScrollOffsetAnimated.read(reader))
324
- - (this._originalTopPadding.get() - this._modifiedTopPadding.read(reader));
323
+ - (this._originalScrollOffsetAnimated.read(undefined) - this._modifiedScrollOffsetAnimated.read(reader))
324
+ - (this._originalTopPadding.read(undefined) - this._modifiedTopPadding.read(reader));
325
325
  if (newScrollTopModified !== this._editors.modified.getScrollTop()) {
326
326
  this._editors.modified.setScrollTop(newScrollTopModified, 1 /* ScrollType.Immediate */);
327
327
  }
@@ -329,8 +329,8 @@ let DiffEditorViewZones = class DiffEditorViewZones extends Disposable {
329
329
  this._register(autorun(reader => {
330
330
  /** @description update scroll original */
331
331
  const newScrollTopOriginal = this._modifiedScrollTop.read(reader)
332
- - (this._modifiedScrollOffsetAnimated.get() - this._originalScrollOffsetAnimated.read(reader))
333
- - (this._modifiedTopPadding.get() - this._originalTopPadding.read(reader));
332
+ - (this._modifiedScrollOffsetAnimated.read(undefined) - this._originalScrollOffsetAnimated.read(reader))
333
+ - (this._modifiedTopPadding.read(undefined) - this._originalTopPadding.read(reader));
334
334
  if (newScrollTopOriginal !== this._editors.original.getScrollTop()) {
335
335
  this._editors.original.setScrollTop(newScrollTopOriginal, 1 /* ScrollType.Immediate */);
336
336
  }
@@ -340,8 +340,8 @@ let DiffEditorViewZones = class DiffEditorViewZones extends Disposable {
340
340
  const m = this._diffModel.read(reader)?.movedTextToCompare.read(reader);
341
341
  let deltaOrigToMod = 0;
342
342
  if (m) {
343
- const trueTopOriginal = this._editors.original.getTopForLineNumber(m.lineRangeMapping.original.startLineNumber, true) - this._originalTopPadding.get();
344
- const trueTopModified = this._editors.modified.getTopForLineNumber(m.lineRangeMapping.modified.startLineNumber, true) - this._modifiedTopPadding.get();
343
+ const trueTopOriginal = this._editors.original.getTopForLineNumber(m.lineRangeMapping.original.startLineNumber, true) - this._originalTopPadding.read(undefined);
344
+ const trueTopModified = this._editors.modified.getTopForLineNumber(m.lineRangeMapping.modified.startLineNumber, true) - this._modifiedTopPadding.read(undefined);
345
345
  deltaOrigToMod = trueTopModified - trueTopOriginal;
346
346
  }
347
347
  if (deltaOrigToMod > 0) {
@@ -359,10 +359,10 @@ let DiffEditorViewZones = class DiffEditorViewZones extends Disposable {
359
359
  }, 400);
360
360
  }
361
361
  if (this._editors.modified.hasTextFocus()) {
362
- this._originalScrollOffset.set(this._modifiedScrollOffset.get() - deltaOrigToMod, undefined, true);
362
+ this._originalScrollOffset.set(this._modifiedScrollOffset.read(undefined) - deltaOrigToMod, undefined, true);
363
363
  }
364
364
  else {
365
- this._modifiedScrollOffset.set(this._originalScrollOffset.get() + deltaOrigToMod, undefined, true);
365
+ this._modifiedScrollOffset.set(this._originalScrollOffset.read(undefined) + deltaOrigToMod, undefined, true);
366
366
  }
367
367
  }));
368
368
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.ts","vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAAE,CAAC,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AACzF,OAAO,EAAe,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAClI,OAAO,EAAE,SAAS,EAAE,MAAM,4CAA4C,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAElE,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAE3F,OAAO,EAAuB,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAEhF,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAuB,kBAAkB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEtF,OAAO,EAAE,SAAS,EAAE,MAAM,gDAAgD,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAIlE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iEAAiE,CAAC;AACpG,OAAO,EAAE,mBAAmB,EAAE,MAAM,+DAA+D,CAAC;AAEpG,OAAO,EAAE,KAAK,EAAE,MAAM,qCAAqC,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CACrD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAY;IAC7C,OAAO,KAAK,CAAC,eAAe,KAAK,KAAK,CAAC,aAAa,CAAC;AACtD,CAAC","file":"diffEditorViewZones.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { $, addDisposableListener } from '../../../../../../base/browser/dom.js';\nimport { ArrayQueue } from '../../../../../../base/common/arrays.js';\nimport { RunOnceScheduler } from '../../../../../../base/common/async.js';\nimport { Codicon } from '../../../../../../base/common/codicons.js';\nimport { Disposable, DisposableStore } from '../../../../../../base/common/lifecycle.js';\nimport { IObservable, autorun, derived, observableFromEvent, observableValue } from '../../../../../../base/common/observable.js';\nimport { ThemeIcon } from '../../../../../../base/common/themables.js';\nimport { assertReturnsDefined } from '../../../../../../base/common/types.js';\nimport { applyFontInfo } from '../../../../config/domFontInfo.js';\nimport { CodeEditorWidget } from '../../../codeEditor/codeEditorWidget.js';\nimport { diffDeleteDecoration, diffRemoveIcon } from '../../registrations.contribution.js';\nimport { DiffEditorEditors } from '../diffEditorEditors.js';\nimport { DiffEditorViewModel, DiffMapping } from '../../diffEditorViewModel.js';\nimport { DiffEditorWidget } from '../../diffEditorWidget.js';\nimport { InlineDiffDeletedCodeMargin } from './inlineDiffDeletedCodeMargin.js';\nimport { LineSource, RenderOptions, renderLines } from './renderLines.js';\nimport { IObservableViewZone, animatedObservable, joinCombine } from '../../utils.js';\nimport { EditorOption } from '../../../../../common/config/editorOptions.js';\nimport { LineRange } from '../../../../../common/core/ranges/lineRange.js';\nimport { Position } from '../../../../../common/core/position.js';\nimport { DetailedLineRangeMapping } from '../../../../../common/diff/rangeMapping.js';\nimport { ScrollType } from '../../../../../common/editorCommon.js';\nimport { BackgroundTokenizationState } from '../../../../../common/tokenizationTextModelPart.js';\nimport { IClipboardService } from '../../../../../../platform/clipboard/common/clipboardService.js';\nimport { IContextMenuService } from '../../../../../../platform/contextview/browser/contextView.js';\nimport { DiffEditorOptions } from '../../diffEditorOptions.js';\nimport { Range } from '../../../../../common/core/range.js';\nimport { InlineDecoration, InlineDecorationType } from '../../../../../common/viewModel/inlineDecorations.js';\n\n/**\n * Ensures both editors have the same height by aligning unchanged lines.\n * In inline view mode, inserts viewzones to show deleted code from the original text model in the modified code editor.\n * Synchronizes scrolling.\n *\n * Make sure to add the view zones!\n */\nexport class DiffEditorViewZones extends Disposable {\n\tprivate readonly _originalTopPadding;\n\tprivate readonly _originalScrollTop: IObservable<number>;\n\tprivate readonly _originalScrollOffset;\n\tprivate readonly _originalScrollOffsetAnimated;\n\n\tprivate readonly _modifiedTopPadding;\n\tprivate readonly _modifiedScrollTop: IObservable<number>;\n\tprivate readonly _modifiedScrollOffset;\n\tprivate readonly _modifiedScrollOffsetAnimated;\n\n\tpublic readonly viewZones: IObservable<{ orig: IObservableViewZone[]; mod: IObservableViewZone[] }>;\n\n\tconstructor(\n\t\tprivate readonly _targetWindow: Window,\n\t\tprivate readonly _editors: DiffEditorEditors,\n\t\tprivate readonly _diffModel: IObservable<DiffEditorViewModel | undefined>,\n\t\tprivate readonly _options: DiffEditorOptions,\n\t\tprivate readonly _diffEditorWidget: DiffEditorWidget,\n\t\tprivate readonly _canIgnoreViewZoneUpdateEvent: () => boolean,\n\t\tprivate readonly _origViewZonesToIgnore: Set<string>,\n\t\tprivate readonly _modViewZonesToIgnore: Set<string>,\n\t\t@IClipboardService private readonly _clipboardService: IClipboardService,\n\t\t@IContextMenuService private readonly _contextMenuService: IContextMenuService,\n\t) {\n\t\tsuper();\n\t\tthis._originalTopPadding = observableValue(this, 0);\n\t\tthis._originalScrollOffset = observableValue<number, boolean>(this, 0);\n\t\tthis._originalScrollOffsetAnimated = animatedObservable(this._targetWindow, this._originalScrollOffset, this._store);\n\t\tthis._modifiedTopPadding = observableValue(this, 0);\n\t\tthis._modifiedScrollOffset = observableValue<number, boolean>(this, 0);\n\t\tthis._modifiedScrollOffsetAnimated = animatedObservable(this._targetWindow, this._modifiedScrollOffset, this._store);\n\n\t\tconst state = observableValue('invalidateAlignmentsState', 0);\n\n\t\tconst updateImmediately = this._register(new RunOnceScheduler(() => {\n\t\t\tstate.set(state.get() + 1, undefined);\n\t\t}, 0));\n\n\t\tthis._register(this._editors.original.onDidChangeViewZones((_args) => { if (!this._canIgnoreViewZoneUpdateEvent()) { updateImmediately.schedule(); } }));\n\t\tthis._register(this._editors.modified.onDidChangeViewZones((_args) => { if (!this._canIgnoreViewZoneUpdateEvent()) { updateImmediately.schedule(); } }));\n\t\tthis._register(this._editors.original.onDidChangeConfiguration((args) => {\n\t\t\tif (args.hasChanged(EditorOption.wrappingInfo) || args.hasChanged(EditorOption.lineHeight)) { updateImmediately.schedule(); }\n\t\t}));\n\t\tthis._register(this._editors.modified.onDidChangeConfiguration((args) => {\n\t\t\tif (args.hasChanged(EditorOption.wrappingInfo) || args.hasChanged(EditorOption.lineHeight)) { updateImmediately.schedule(); }\n\t\t}));\n\n\t\tconst originalModelTokenizationCompleted = this._diffModel.map(m =>\n\t\t\tm ? observableFromEvent(this, m.model.original.onDidChangeTokens, () => m.model.original.tokenization.backgroundTokenizationState === BackgroundTokenizationState.Completed) : undefined\n\t\t).map((m, reader) => m?.read(reader));\n\n\t\tconst alignments = derived<ILineRangeAlignment[] | null>((reader) => {\n\t\t\t/** @description alignments */\n\t\t\tconst diffModel = this._diffModel.read(reader);\n\t\t\tconst diff = diffModel?.diff.read(reader);\n\t\t\tif (!diffModel || !diff) { return null; }\n\t\t\tstate.read(reader);\n\t\t\tconst renderSideBySide = this._options.renderSideBySide.read(reader);\n\t\t\tconst innerHunkAlignment = renderSideBySide;\n\t\t\treturn computeRangeAlignment(\n\t\t\t\tthis._editors.original,\n\t\t\t\tthis._editors.modified,\n\t\t\t\tdiff.mappings,\n\t\t\t\tthis._origViewZonesToIgnore,\n\t\t\t\tthis._modViewZonesToIgnore,\n\t\t\t\tinnerHunkAlignment\n\t\t\t);\n\t\t});\n\n\t\tconst alignmentsSyncedMovedText = derived<ILineRangeAlignment[] | null>((reader) => {\n\t\t\t/** @description alignmentsSyncedMovedText */\n\t\t\tconst syncedMovedText = this._diffModel.read(reader)?.movedTextToCompare.read(reader);\n\t\t\tif (!syncedMovedText) { return null; }\n\t\t\tstate.read(reader);\n\t\t\tconst mappings = syncedMovedText.changes.map(c => new DiffMapping(c));\n\t\t\t// TODO dont include alignments outside syncedMovedText\n\t\t\treturn computeRangeAlignment(\n\t\t\t\tthis._editors.original,\n\t\t\t\tthis._editors.modified,\n\t\t\t\tmappings,\n\t\t\t\tthis._origViewZonesToIgnore,\n\t\t\t\tthis._modViewZonesToIgnore,\n\t\t\t\ttrue\n\t\t\t);\n\t\t});\n\n\t\tfunction createFakeLinesDiv(): HTMLElement {\n\t\t\tconst r = document.createElement('div');\n\t\t\tr.className = 'diagonal-fill';\n\t\t\treturn r;\n\t\t}\n\n\t\tconst alignmentViewZonesDisposables = this._register(new DisposableStore());\n\t\tthis.viewZones = derived<{ orig: IObservableViewZone[]; mod: IObservableViewZone[] }>(this, (reader) => {\n\t\t\talignmentViewZonesDisposables.clear();\n\n\t\t\tconst alignmentsVal = alignments.read(reader) || [];\n\n\t\t\tconst origViewZones: IObservableViewZone[] = [];\n\t\t\tconst modViewZones: IObservableViewZone[] = [];\n\n\t\t\tconst modifiedTopPaddingVal = this._modifiedTopPadding.read(reader);\n\t\t\tif (modifiedTopPaddingVal > 0) {\n\t\t\t\tmodViewZones.push({\n\t\t\t\t\tafterLineNumber: 0,\n\t\t\t\t\tdomNode: document.createElement('div'),\n\t\t\t\t\theightInPx: modifiedTopPaddingVal,\n\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst originalTopPaddingVal = this._originalTopPadding.read(reader);\n\t\t\tif (originalTopPaddingVal > 0) {\n\t\t\t\torigViewZones.push({\n\t\t\t\t\tafterLineNumber: 0,\n\t\t\t\t\tdomNode: document.createElement('div'),\n\t\t\t\t\theightInPx: originalTopPaddingVal,\n\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst renderSideBySide = this._options.renderSideBySide.read(reader);\n\n\t\t\tconst deletedCodeLineBreaksComputer = !renderSideBySide ? this._editors.modified._getViewModel()?.createLineBreaksComputer() : undefined;\n\t\t\tif (deletedCodeLineBreaksComputer) {\n\t\t\t\tconst originalModel = this._editors.original.getModel()!;\n\t\t\t\tfor (const a of alignmentsVal) {\n\t\t\t\t\tif (a.diff) {\n\t\t\t\t\t\tfor (let i = a.originalRange.startLineNumber; i < a.originalRange.endLineNumberExclusive; i++) {\n\t\t\t\t\t\t\t// `i` can be out of bound when the diff has not been updated yet.\n\t\t\t\t\t\t\t// In this case, we do an early return.\n\t\t\t\t\t\t\t// TODO@hediet: Fix this by applying the edit directly to the diff model, so that the diff is always valid.\n\t\t\t\t\t\t\tif (i > originalModel.getLineCount()) {\n\t\t\t\t\t\t\t\treturn { orig: origViewZones, mod: modViewZones };\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdeletedCodeLineBreaksComputer?.addRequest(originalModel.getLineContent(i), null, null);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst lineBreakData = deletedCodeLineBreaksComputer?.finalize() ?? [];\n\t\t\tlet lineBreakDataIdx = 0;\n\n\t\t\tconst modLineHeight = this._editors.modified.getOption(EditorOption.lineHeight);\n\n\t\t\tconst syncedMovedText = this._diffModel.read(reader)?.movedTextToCompare.read(reader);\n\n\t\t\tconst mightContainNonBasicASCII = this._editors.original.getModel()?.mightContainNonBasicASCII() ?? false;\n\t\t\tconst mightContainRTL = this._editors.original.getModel()?.mightContainRTL() ?? false;\n\t\t\tconst renderOptions = RenderOptions.fromEditor(this._editors.modified);\n\n\t\t\tfor (const a of alignmentsVal) {\n\t\t\t\tif (a.diff && !renderSideBySide && (!this._options.useTrueInlineDiffRendering.read(reader) || !allowsTrueInlineDiffRendering(a.diff))) {\n\t\t\t\t\tif (!a.originalRange.isEmpty) {\n\t\t\t\t\t\toriginalModelTokenizationCompleted.read(reader); // Update view-zones once tokenization completes\n\n\t\t\t\t\t\tconst deletedCodeDomNode = document.createElement('div');\n\t\t\t\t\t\tdeletedCodeDomNode.classList.add('view-lines', 'line-delete', 'monaco-mouse-cursor-text');\n\t\t\t\t\t\tconst originalModel = this._editors.original.getModel()!;\n\t\t\t\t\t\t// `a.originalRange` can be out of bound when the diff has not been updated yet.\n\t\t\t\t\t\t// In this case, we do an early return.\n\t\t\t\t\t\t// TODO@hediet: Fix this by applying the edit directly to the diff model, so that the diff is always valid.\n\t\t\t\t\t\tif (a.originalRange.endLineNumberExclusive - 1 > originalModel.getLineCount()) {\n\t\t\t\t\t\t\treturn { orig: origViewZones, mod: modViewZones };\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst source = new LineSource(\n\t\t\t\t\t\t\ta.originalRange.mapToLineArray(l => originalModel.tokenization.getLineTokens(l)),\n\t\t\t\t\t\t\ta.originalRange.mapToLineArray(_ => lineBreakData[lineBreakDataIdx++]),\n\t\t\t\t\t\t\tmightContainNonBasicASCII,\n\t\t\t\t\t\t\tmightContainRTL,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst decorations: InlineDecoration[] = [];\n\t\t\t\t\t\tfor (const i of a.diff.innerChanges || []) {\n\t\t\t\t\t\t\tdecorations.push(new InlineDecoration(\n\t\t\t\t\t\t\t\ti.originalRange.delta(-(a.diff.original.startLineNumber - 1)),\n\t\t\t\t\t\t\t\tdiffDeleteDecoration.className!,\n\t\t\t\t\t\t\t\tInlineDecorationType.Regular\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst result = renderLines(source, renderOptions, decorations, deletedCodeDomNode);\n\n\t\t\t\t\t\tconst marginDomNode = document.createElement('div');\n\t\t\t\t\t\tmarginDomNode.className = 'inline-deleted-margin-view-zone';\n\t\t\t\t\t\tapplyFontInfo(marginDomNode, renderOptions.fontInfo);\n\n\t\t\t\t\t\tif (this._options.renderIndicators.read(reader)) {\n\t\t\t\t\t\t\tfor (let i = 0; i < result.heightInLines; i++) {\n\t\t\t\t\t\t\t\tconst marginElement = document.createElement('div');\n\t\t\t\t\t\t\t\tmarginElement.className = `delete-sign ${ThemeIcon.asClassName(diffRemoveIcon)}`;\n\t\t\t\t\t\t\t\tmarginElement.setAttribute('style', `position:absolute;top:${i * modLineHeight}px;width:${renderOptions.lineDecorationsWidth}px;height:${modLineHeight}px;right:0;`);\n\t\t\t\t\t\t\t\tmarginDomNode.appendChild(marginElement);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet zoneId: string | undefined = undefined;\n\t\t\t\t\t\talignmentViewZonesDisposables.add(\n\t\t\t\t\t\t\tnew InlineDiffDeletedCodeMargin(\n\t\t\t\t\t\t\t\t() => assertReturnsDefined(zoneId),\n\t\t\t\t\t\t\t\tmarginDomNode,\n\t\t\t\t\t\t\t\tthis._editors.modified,\n\t\t\t\t\t\t\t\ta.diff,\n\t\t\t\t\t\t\t\tthis._diffEditorWidget,\n\t\t\t\t\t\t\t\tresult.viewLineCounts,\n\t\t\t\t\t\t\t\tthis._editors.original.getModel()!,\n\t\t\t\t\t\t\t\tthis._contextMenuService,\n\t\t\t\t\t\t\t\tthis._clipboardService,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tfor (let i = 0; i < result.viewLineCounts.length; i++) {\n\t\t\t\t\t\t\tconst count = result.viewLineCounts[i];\n\t\t\t\t\t\t\t// Account for wrapped lines in the (collapsed) original editor (which doesn't wrap lines).\n\t\t\t\t\t\t\tif (count > 1) {\n\t\t\t\t\t\t\t\torigViewZones.push({\n\t\t\t\t\t\t\t\t\tafterLineNumber: a.originalRange.startLineNumber + i,\n\t\t\t\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\t\t\t\theightInPx: (count - 1) * modLineHeight,\n\t\t\t\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmodViewZones.push({\n\t\t\t\t\t\t\tafterLineNumber: a.modifiedRange.startLineNumber - 1,\n\t\t\t\t\t\t\tdomNode: deletedCodeDomNode,\n\t\t\t\t\t\t\theightInPx: result.heightInLines * modLineHeight,\n\t\t\t\t\t\t\tminWidthInPx: result.minWidthInPx,\n\t\t\t\t\t\t\tmarginDomNode,\n\t\t\t\t\t\t\tsetZoneId(id) { zoneId = id; },\n\t\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tconst marginDomNode = document.createElement('div');\n\t\t\t\t\tmarginDomNode.className = 'gutter-delete';\n\n\t\t\t\t\torigViewZones.push({\n\t\t\t\t\t\tafterLineNumber: a.originalRange.endLineNumberExclusive - 1,\n\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\theightInPx: a.modifiedHeightInPx,\n\t\t\t\t\t\tmarginDomNode,\n\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tconst delta = a.modifiedHeightInPx - a.originalHeightInPx;\n\t\t\t\t\tif (delta > 0) {\n\t\t\t\t\t\tif (syncedMovedText?.lineRangeMapping.original.delta(-1).deltaLength(2).contains(a.originalRange.endLineNumberExclusive - 1)) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\torigViewZones.push({\n\t\t\t\t\t\t\tafterLineNumber: a.originalRange.endLineNumberExclusive - 1,\n\t\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\t\theightInPx: delta,\n\t\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (syncedMovedText?.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(a.modifiedRange.endLineNumberExclusive - 1)) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction createViewZoneMarginArrow(): HTMLElement {\n\t\t\t\t\t\t\tconst arrow = document.createElement('div');\n\t\t\t\t\t\t\tarrow.className = 'arrow-revert-change ' + ThemeIcon.asClassName(Codicon.arrowRight);\n\t\t\t\t\t\t\treader.store.add(addDisposableListener(arrow, 'mousedown', e => e.stopPropagation()));\n\t\t\t\t\t\t\treader.store.add(addDisposableListener(arrow, 'click', e => {\n\t\t\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\t\t\t_diffEditorWidget.revert(a.diff!);\n\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t\treturn $('div', {}, arrow);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet marginDomNode: HTMLElement | undefined = undefined;\n\t\t\t\t\t\tif (a.diff && a.diff.modified.isEmpty && this._options.shouldRenderOldRevertArrows.read(reader)) {\n\t\t\t\t\t\t\tmarginDomNode = createViewZoneMarginArrow();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmodViewZones.push({\n\t\t\t\t\t\t\tafterLineNumber: a.modifiedRange.endLineNumberExclusive - 1,\n\t\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\t\theightInPx: -delta,\n\t\t\t\t\t\t\tmarginDomNode,\n\t\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (const a of alignmentsSyncedMovedText.read(reader) ?? []) {\n\t\t\t\tif (!syncedMovedText?.lineRangeMapping.original.intersect(a.originalRange)\n\t\t\t\t\t|| !syncedMovedText?.lineRangeMapping.modified.intersect(a.modifiedRange)) {\n\t\t\t\t\t// ignore unrelated alignments outside the synced moved text\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst delta = a.modifiedHeightInPx - a.originalHeightInPx;\n\t\t\t\tif (delta > 0) {\n\t\t\t\t\torigViewZones.push({\n\t\t\t\t\t\tafterLineNumber: a.originalRange.endLineNumberExclusive - 1,\n\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\theightInPx: delta,\n\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tmodViewZones.push({\n\t\t\t\t\t\tafterLineNumber: a.modifiedRange.endLineNumberExclusive - 1,\n\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\theightInPx: -delta,\n\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn { orig: origViewZones, mod: modViewZones };\n\t\t});\n\n\t\tlet ignoreChange = false;\n\t\tthis._register(this._editors.original.onDidScrollChange(e => {\n\t\t\tif (e.scrollLeftChanged && !ignoreChange) {\n\t\t\t\tignoreChange = true;\n\t\t\t\tthis._editors.modified.setScrollLeft(e.scrollLeft);\n\t\t\t\tignoreChange = false;\n\t\t\t}\n\t\t}));\n\t\tthis._register(this._editors.modified.onDidScrollChange(e => {\n\t\t\tif (e.scrollLeftChanged && !ignoreChange) {\n\t\t\t\tignoreChange = true;\n\t\t\t\tthis._editors.original.setScrollLeft(e.scrollLeft);\n\t\t\t\tignoreChange = false;\n\t\t\t}\n\t\t}));\n\n\t\tthis._originalScrollTop = observableFromEvent(this._editors.original.onDidScrollChange, () => /** @description original.getScrollTop */ this._editors.original.getScrollTop());\n\t\tthis._modifiedScrollTop = observableFromEvent(this._editors.modified.onDidScrollChange, () => /** @description modified.getScrollTop */ this._editors.modified.getScrollTop());\n\n\t\t// origExtraHeight + origOffset - origScrollTop = modExtraHeight + modOffset - modScrollTop\n\n\t\t// origScrollTop = origExtraHeight + origOffset - modExtraHeight - modOffset + modScrollTop\n\t\t// modScrollTop = modExtraHeight + modOffset - origExtraHeight - origOffset + origScrollTop\n\n\t\t// origOffset - modOffset = heightOfLines(1..Y) - heightOfLines(1..X)\n\t\t// origScrollTop >= 0, modScrollTop >= 0\n\n\t\tthis._register(autorun(reader => {\n\t\t\t/** @description update scroll modified */\n\t\t\tconst newScrollTopModified = this._originalScrollTop.read(reader)\n\t\t\t\t- (this._originalScrollOffsetAnimated.get() - this._modifiedScrollOffsetAnimated.read(reader))\n\t\t\t\t- (this._originalTopPadding.get() - this._modifiedTopPadding.read(reader));\n\t\t\tif (newScrollTopModified !== this._editors.modified.getScrollTop()) {\n\t\t\t\tthis._editors.modified.setScrollTop(newScrollTopModified, ScrollType.Immediate);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\t/** @description update scroll original */\n\t\t\tconst newScrollTopOriginal = this._modifiedScrollTop.read(reader)\n\t\t\t\t- (this._modifiedScrollOffsetAnimated.get() - this._originalScrollOffsetAnimated.read(reader))\n\t\t\t\t- (this._modifiedTopPadding.get() - this._originalTopPadding.read(reader));\n\t\t\tif (newScrollTopOriginal !== this._editors.original.getScrollTop()) {\n\t\t\t\tthis._editors.original.setScrollTop(newScrollTopOriginal, ScrollType.Immediate);\n\t\t\t}\n\t\t}));\n\n\n\t\tthis._register(autorun(reader => {\n\t\t\t/** @description update editor top offsets */\n\t\t\tconst m = this._diffModel.read(reader)?.movedTextToCompare.read(reader);\n\n\t\t\tlet deltaOrigToMod = 0;\n\t\t\tif (m) {\n\t\t\t\tconst trueTopOriginal = this._editors.original.getTopForLineNumber(m.lineRangeMapping.original.startLineNumber, true) - this._originalTopPadding.get();\n\t\t\t\tconst trueTopModified = this._editors.modified.getTopForLineNumber(m.lineRangeMapping.modified.startLineNumber, true) - this._modifiedTopPadding.get();\n\t\t\t\tdeltaOrigToMod = trueTopModified - trueTopOriginal;\n\t\t\t}\n\n\t\t\tif (deltaOrigToMod > 0) {\n\t\t\t\tthis._modifiedTopPadding.set(0, undefined);\n\t\t\t\tthis._originalTopPadding.set(deltaOrigToMod, undefined);\n\t\t\t} else if (deltaOrigToMod < 0) {\n\t\t\t\tthis._modifiedTopPadding.set(-deltaOrigToMod, undefined);\n\t\t\t\tthis._originalTopPadding.set(0, undefined);\n\t\t\t} else {\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tthis._modifiedTopPadding.set(0, undefined);\n\t\t\t\t\tthis._originalTopPadding.set(0, undefined);\n\t\t\t\t}, 400);\n\t\t\t}\n\n\t\t\tif (this._editors.modified.hasTextFocus()) {\n\t\t\t\tthis._originalScrollOffset.set(this._modifiedScrollOffset.get() - deltaOrigToMod, undefined, true);\n\t\t\t} else {\n\t\t\t\tthis._modifiedScrollOffset.set(this._originalScrollOffset.get() + deltaOrigToMod, undefined, true);\n\t\t\t}\n\t\t}));\n\t}\n}\n\ninterface ILineRangeAlignment {\n\toriginalRange: LineRange;\n\tmodifiedRange: LineRange;\n\n\t// accounts for foreign viewzones and line wrapping\n\toriginalHeightInPx: number;\n\tmodifiedHeightInPx: number;\n\n\t/**\n\t * If this range alignment is a direct result of a diff, then this is the diff's line mapping.\n\t * Only used for inline-view.\n\t */\n\tdiff?: DetailedLineRangeMapping;\n}\n\nfunction computeRangeAlignment(\n\toriginalEditor: CodeEditorWidget,\n\tmodifiedEditor: CodeEditorWidget,\n\tdiffs: readonly DiffMapping[],\n\toriginalEditorAlignmentViewZones: ReadonlySet<string>,\n\tmodifiedEditorAlignmentViewZones: ReadonlySet<string>,\n\tinnerHunkAlignment: boolean,\n): ILineRangeAlignment[] {\n\tconst originalLineHeightOverrides = new ArrayQueue(getAdditionalLineHeights(originalEditor, originalEditorAlignmentViewZones));\n\tconst modifiedLineHeightOverrides = new ArrayQueue(getAdditionalLineHeights(modifiedEditor, modifiedEditorAlignmentViewZones));\n\n\tconst origLineHeight = originalEditor.getOption(EditorOption.lineHeight);\n\tconst modLineHeight = modifiedEditor.getOption(EditorOption.lineHeight);\n\n\tconst result: ILineRangeAlignment[] = [];\n\n\tlet lastOriginalLineNumber = 0;\n\tlet lastModifiedLineNumber = 0;\n\n\tfunction handleAlignmentsOutsideOfDiffs(untilOriginalLineNumberExclusive: number, untilModifiedLineNumberExclusive: number) {\n\t\twhile (true) {\n\t\t\tlet origNext = originalLineHeightOverrides.peek();\n\t\t\tlet modNext = modifiedLineHeightOverrides.peek();\n\t\t\tif (origNext && origNext.lineNumber >= untilOriginalLineNumberExclusive) {\n\t\t\t\torigNext = undefined;\n\t\t\t}\n\t\t\tif (modNext && modNext.lineNumber >= untilModifiedLineNumberExclusive) {\n\t\t\t\tmodNext = undefined;\n\t\t\t}\n\t\t\tif (!origNext && !modNext) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst distOrig = origNext ? origNext.lineNumber - lastOriginalLineNumber : Number.MAX_VALUE;\n\t\t\tconst distNext = modNext ? modNext.lineNumber - lastModifiedLineNumber : Number.MAX_VALUE;\n\n\t\t\tif (distOrig < distNext) {\n\t\t\t\toriginalLineHeightOverrides.dequeue();\n\t\t\t\tmodNext = {\n\t\t\t\t\tlineNumber: origNext!.lineNumber - lastOriginalLineNumber + lastModifiedLineNumber,\n\t\t\t\t\theightInPx: 0,\n\t\t\t\t};\n\t\t\t} else if (distOrig > distNext) {\n\t\t\t\tmodifiedLineHeightOverrides.dequeue();\n\t\t\t\torigNext = {\n\t\t\t\t\tlineNumber: modNext!.lineNumber - lastModifiedLineNumber + lastOriginalLineNumber,\n\t\t\t\t\theightInPx: 0,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\toriginalLineHeightOverrides.dequeue();\n\t\t\t\tmodifiedLineHeightOverrides.dequeue();\n\t\t\t}\n\n\t\t\tresult.push({\n\t\t\t\toriginalRange: LineRange.ofLength(origNext!.lineNumber, 1),\n\t\t\t\tmodifiedRange: LineRange.ofLength(modNext!.lineNumber, 1),\n\t\t\t\toriginalHeightInPx: origLineHeight + origNext!.heightInPx,\n\t\t\t\tmodifiedHeightInPx: modLineHeight + modNext!.heightInPx,\n\t\t\t\tdiff: undefined,\n\t\t\t});\n\t\t}\n\t}\n\n\tfor (const m of diffs) {\n\t\tconst c = m.lineRangeMapping;\n\t\thandleAlignmentsOutsideOfDiffs(c.original.startLineNumber, c.modified.startLineNumber);\n\n\t\tlet first = true;\n\t\tlet lastModLineNumber = c.modified.startLineNumber;\n\t\tlet lastOrigLineNumber = c.original.startLineNumber;\n\n\t\tfunction emitAlignment(origLineNumberExclusive: number, modLineNumberExclusive: number, forceAlignment = false) {\n\t\t\tif (origLineNumberExclusive < lastOrigLineNumber || modLineNumberExclusive < lastModLineNumber) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (first) {\n\t\t\t\tfirst = false;\n\t\t\t} else if (!forceAlignment && (origLineNumberExclusive === lastOrigLineNumber || modLineNumberExclusive === lastModLineNumber)) {\n\t\t\t\t// This causes a re-alignment of an already aligned line.\n\t\t\t\t// However, we don't care for the final alignment.\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst originalRange = new LineRange(lastOrigLineNumber, origLineNumberExclusive);\n\t\t\tconst modifiedRange = new LineRange(lastModLineNumber, modLineNumberExclusive);\n\t\t\tif (originalRange.isEmpty && modifiedRange.isEmpty) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst originalAdditionalHeight = originalLineHeightOverrides\n\t\t\t\t.takeWhile(v => v.lineNumber < origLineNumberExclusive)\n\t\t\t\t?.reduce((p, c) => p + c.heightInPx, 0) ?? 0;\n\t\t\tconst modifiedAdditionalHeight = modifiedLineHeightOverrides\n\t\t\t\t.takeWhile(v => v.lineNumber < modLineNumberExclusive)\n\t\t\t\t?.reduce((p, c) => p + c.heightInPx, 0) ?? 0;\n\n\t\t\tresult.push({\n\t\t\t\toriginalRange,\n\t\t\t\tmodifiedRange,\n\t\t\t\toriginalHeightInPx: originalRange.length * origLineHeight + originalAdditionalHeight,\n\t\t\t\tmodifiedHeightInPx: modifiedRange.length * modLineHeight + modifiedAdditionalHeight,\n\t\t\t\tdiff: m.lineRangeMapping,\n\t\t\t});\n\n\t\t\tlastOrigLineNumber = origLineNumberExclusive;\n\t\t\tlastModLineNumber = modLineNumberExclusive;\n\t\t}\n\n\t\tif (innerHunkAlignment) {\n\t\t\tfor (const i of c.innerChanges || []) {\n\t\t\t\tif (i.originalRange.startColumn > 1 && i.modifiedRange.startColumn > 1) {\n\t\t\t\t\t// There is some unmodified text on this line before the diff\n\t\t\t\t\temitAlignment(i.originalRange.startLineNumber, i.modifiedRange.startLineNumber);\n\t\t\t\t}\n\t\t\t\tconst originalModel = originalEditor.getModel()!;\n\t\t\t\t// When the diff is invalid, the ranges might be out of bounds (this should be fixed in the diff model by applying edits directly).\n\t\t\t\tconst maxColumn = i.originalRange.endLineNumber <= originalModel.getLineCount() ? originalModel.getLineMaxColumn(i.originalRange.endLineNumber) : Number.MAX_SAFE_INTEGER;\n\t\t\t\tif (i.originalRange.endColumn < maxColumn) {\n\t\t\t\t\t// // There is some unmodified text on this line after the diff\n\t\t\t\t\temitAlignment(i.originalRange.endLineNumber, i.modifiedRange.endLineNumber);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\temitAlignment(c.original.endLineNumberExclusive, c.modified.endLineNumberExclusive, true);\n\n\t\tlastOriginalLineNumber = c.original.endLineNumberExclusive;\n\t\tlastModifiedLineNumber = c.modified.endLineNumberExclusive;\n\t}\n\thandleAlignmentsOutsideOfDiffs(Number.MAX_VALUE, Number.MAX_VALUE);\n\n\treturn result;\n}\n\ninterface AdditionalLineHeightInfo {\n\tlineNumber: number;\n\theightInPx: number;\n}\n\nfunction getAdditionalLineHeights(editor: CodeEditorWidget, viewZonesToIgnore: ReadonlySet<string>): readonly AdditionalLineHeightInfo[] {\n\tconst viewZoneHeights: { lineNumber: number; heightInPx: number }[] = [];\n\tconst wrappingZoneHeights: { lineNumber: number; heightInPx: number }[] = [];\n\n\tconst hasWrapping = editor.getOption(EditorOption.wrappingInfo).wrappingColumn !== -1;\n\tconst coordinatesConverter = editor._getViewModel()!.coordinatesConverter;\n\tconst editorLineHeight = editor.getOption(EditorOption.lineHeight);\n\tif (hasWrapping) {\n\t\tfor (let i = 1; i <= editor.getModel()!.getLineCount(); i++) {\n\t\t\tconst lineCount = coordinatesConverter.getModelLineViewLineCount(i);\n\t\t\tif (lineCount > 1) {\n\t\t\t\twrappingZoneHeights.push({ lineNumber: i, heightInPx: editorLineHeight * (lineCount - 1) });\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (const w of editor.getWhitespaces()) {\n\t\tif (viewZonesToIgnore.has(w.id)) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst modelLineNumber = w.afterLineNumber === 0 ? 0 : coordinatesConverter.convertViewPositionToModelPosition(\n\t\t\tnew Position(w.afterLineNumber, 1)\n\t\t).lineNumber;\n\t\tviewZoneHeights.push({ lineNumber: modelLineNumber, heightInPx: w.height });\n\t}\n\n\tconst result = joinCombine(\n\t\tviewZoneHeights,\n\t\twrappingZoneHeights,\n\t\tv => v.lineNumber,\n\t\t(v1, v2) => ({ lineNumber: v1.lineNumber, heightInPx: v1.heightInPx + v2.heightInPx })\n\t);\n\n\treturn result;\n}\n\nexport function allowsTrueInlineDiffRendering(mapping: DetailedLineRangeMapping): boolean {\n\tif (!mapping.innerChanges) {\n\t\treturn false;\n\t}\n\treturn mapping.innerChanges.every(c =>\n\t\t(rangeIsSingleLine(c.modifiedRange) && rangeIsSingleLine(c.originalRange))\n\t\t|| c.originalRange.equalsRange(new Range(1, 1, 1, 1))\n\t);\n}\n\nexport function rangeIsSingleLine(range: Range): boolean {\n\treturn range.startLineNumber === range.endLineNumber;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { $, addDisposableListener } from '../../../../../../base/browser/dom.js';\nimport { ArrayQueue } from '../../../../../../base/common/arrays.js';\nimport { RunOnceScheduler } from '../../../../../../base/common/async.js';\nimport { Codicon } from '../../../../../../base/common/codicons.js';\nimport { Disposable, DisposableStore } from '../../../../../../base/common/lifecycle.js';\nimport { IObservable, autorun, derived, observableFromEvent, observableValue } from '../../../../../../base/common/observable.js';\nimport { ThemeIcon } from '../../../../../../base/common/themables.js';\nimport { assertReturnsDefined } from '../../../../../../base/common/types.js';\nimport { applyFontInfo } from '../../../../config/domFontInfo.js';\nimport { CodeEditorWidget } from '../../../codeEditor/codeEditorWidget.js';\nimport { diffDeleteDecoration, diffRemoveIcon } from '../../registrations.contribution.js';\nimport { DiffEditorEditors } from '../diffEditorEditors.js';\nimport { DiffEditorViewModel, DiffMapping } from '../../diffEditorViewModel.js';\nimport { DiffEditorWidget } from '../../diffEditorWidget.js';\nimport { InlineDiffDeletedCodeMargin } from './inlineDiffDeletedCodeMargin.js';\nimport { LineSource, RenderOptions, renderLines } from './renderLines.js';\nimport { IObservableViewZone, animatedObservable, joinCombine } from '../../utils.js';\nimport { EditorOption } from '../../../../../common/config/editorOptions.js';\nimport { LineRange } from '../../../../../common/core/ranges/lineRange.js';\nimport { Position } from '../../../../../common/core/position.js';\nimport { DetailedLineRangeMapping } from '../../../../../common/diff/rangeMapping.js';\nimport { ScrollType } from '../../../../../common/editorCommon.js';\nimport { BackgroundTokenizationState } from '../../../../../common/tokenizationTextModelPart.js';\nimport { IClipboardService } from '../../../../../../platform/clipboard/common/clipboardService.js';\nimport { IContextMenuService } from '../../../../../../platform/contextview/browser/contextView.js';\nimport { DiffEditorOptions } from '../../diffEditorOptions.js';\nimport { Range } from '../../../../../common/core/range.js';\nimport { InlineDecoration, InlineDecorationType } from '../../../../../common/viewModel/inlineDecorations.js';\n\n/**\n * Ensures both editors have the same height by aligning unchanged lines.\n * In inline view mode, inserts viewzones to show deleted code from the original text model in the modified code editor.\n * Synchronizes scrolling.\n *\n * Make sure to add the view zones!\n */\nexport class DiffEditorViewZones extends Disposable {\n\tprivate readonly _originalTopPadding;\n\tprivate readonly _originalScrollTop: IObservable<number>;\n\tprivate readonly _originalScrollOffset;\n\tprivate readonly _originalScrollOffsetAnimated;\n\n\tprivate readonly _modifiedTopPadding;\n\tprivate readonly _modifiedScrollTop: IObservable<number>;\n\tprivate readonly _modifiedScrollOffset;\n\tprivate readonly _modifiedScrollOffsetAnimated;\n\n\tpublic readonly viewZones: IObservable<{ orig: IObservableViewZone[]; mod: IObservableViewZone[] }>;\n\n\tconstructor(\n\t\tprivate readonly _targetWindow: Window,\n\t\tprivate readonly _editors: DiffEditorEditors,\n\t\tprivate readonly _diffModel: IObservable<DiffEditorViewModel | undefined>,\n\t\tprivate readonly _options: DiffEditorOptions,\n\t\tprivate readonly _diffEditorWidget: DiffEditorWidget,\n\t\tprivate readonly _canIgnoreViewZoneUpdateEvent: () => boolean,\n\t\tprivate readonly _origViewZonesToIgnore: Set<string>,\n\t\tprivate readonly _modViewZonesToIgnore: Set<string>,\n\t\t@IClipboardService private readonly _clipboardService: IClipboardService,\n\t\t@IContextMenuService private readonly _contextMenuService: IContextMenuService,\n\t) {\n\t\tsuper();\n\t\tthis._originalTopPadding = observableValue(this, 0);\n\t\tthis._originalScrollOffset = observableValue<number, boolean>(this, 0);\n\t\tthis._originalScrollOffsetAnimated = animatedObservable(this._targetWindow, this._originalScrollOffset, this._store);\n\t\tthis._modifiedTopPadding = observableValue(this, 0);\n\t\tthis._modifiedScrollOffset = observableValue<number, boolean>(this, 0);\n\t\tthis._modifiedScrollOffsetAnimated = animatedObservable(this._targetWindow, this._modifiedScrollOffset, this._store);\n\n\t\tconst state = observableValue('invalidateAlignmentsState', 0);\n\n\t\tconst updateImmediately = this._register(new RunOnceScheduler(() => {\n\t\t\tstate.set(state.get() + 1, undefined);\n\t\t}, 0));\n\n\t\tthis._register(this._editors.original.onDidChangeViewZones((_args) => { if (!this._canIgnoreViewZoneUpdateEvent()) { updateImmediately.schedule(); } }));\n\t\tthis._register(this._editors.modified.onDidChangeViewZones((_args) => { if (!this._canIgnoreViewZoneUpdateEvent()) { updateImmediately.schedule(); } }));\n\t\tthis._register(this._editors.original.onDidChangeConfiguration((args) => {\n\t\t\tif (args.hasChanged(EditorOption.wrappingInfo) || args.hasChanged(EditorOption.lineHeight)) { updateImmediately.schedule(); }\n\t\t}));\n\t\tthis._register(this._editors.modified.onDidChangeConfiguration((args) => {\n\t\t\tif (args.hasChanged(EditorOption.wrappingInfo) || args.hasChanged(EditorOption.lineHeight)) { updateImmediately.schedule(); }\n\t\t}));\n\n\t\tconst originalModelTokenizationCompleted = this._diffModel.map(m =>\n\t\t\tm ? observableFromEvent(this, m.model.original.onDidChangeTokens, () => m.model.original.tokenization.backgroundTokenizationState === BackgroundTokenizationState.Completed) : undefined\n\t\t).map((m, reader) => m?.read(reader));\n\n\t\tconst alignments = derived<ILineRangeAlignment[] | null>((reader) => {\n\t\t\t/** @description alignments */\n\t\t\tconst diffModel = this._diffModel.read(reader);\n\t\t\tconst diff = diffModel?.diff.read(reader);\n\t\t\tif (!diffModel || !diff) { return null; }\n\t\t\tstate.read(reader);\n\t\t\tconst renderSideBySide = this._options.renderSideBySide.read(reader);\n\t\t\tconst innerHunkAlignment = renderSideBySide;\n\t\t\treturn computeRangeAlignment(\n\t\t\t\tthis._editors.original,\n\t\t\t\tthis._editors.modified,\n\t\t\t\tdiff.mappings,\n\t\t\t\tthis._origViewZonesToIgnore,\n\t\t\t\tthis._modViewZonesToIgnore,\n\t\t\t\tinnerHunkAlignment\n\t\t\t);\n\t\t});\n\n\t\tconst alignmentsSyncedMovedText = derived<ILineRangeAlignment[] | null>((reader) => {\n\t\t\t/** @description alignmentsSyncedMovedText */\n\t\t\tconst syncedMovedText = this._diffModel.read(reader)?.movedTextToCompare.read(reader);\n\t\t\tif (!syncedMovedText) { return null; }\n\t\t\tstate.read(reader);\n\t\t\tconst mappings = syncedMovedText.changes.map(c => new DiffMapping(c));\n\t\t\t// TODO dont include alignments outside syncedMovedText\n\t\t\treturn computeRangeAlignment(\n\t\t\t\tthis._editors.original,\n\t\t\t\tthis._editors.modified,\n\t\t\t\tmappings,\n\t\t\t\tthis._origViewZonesToIgnore,\n\t\t\t\tthis._modViewZonesToIgnore,\n\t\t\t\ttrue\n\t\t\t);\n\t\t});\n\n\t\tfunction createFakeLinesDiv(): HTMLElement {\n\t\t\tconst r = document.createElement('div');\n\t\t\tr.className = 'diagonal-fill';\n\t\t\treturn r;\n\t\t}\n\n\t\tconst alignmentViewZonesDisposables = this._register(new DisposableStore());\n\t\tthis.viewZones = derived<{ orig: IObservableViewZone[]; mod: IObservableViewZone[] }>(this, (reader) => {\n\t\t\talignmentViewZonesDisposables.clear();\n\n\t\t\tconst alignmentsVal = alignments.read(reader) || [];\n\n\t\t\tconst origViewZones: IObservableViewZone[] = [];\n\t\t\tconst modViewZones: IObservableViewZone[] = [];\n\n\t\t\tconst modifiedTopPaddingVal = this._modifiedTopPadding.read(reader);\n\t\t\tif (modifiedTopPaddingVal > 0) {\n\t\t\t\tmodViewZones.push({\n\t\t\t\t\tafterLineNumber: 0,\n\t\t\t\t\tdomNode: document.createElement('div'),\n\t\t\t\t\theightInPx: modifiedTopPaddingVal,\n\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst originalTopPaddingVal = this._originalTopPadding.read(reader);\n\t\t\tif (originalTopPaddingVal > 0) {\n\t\t\t\torigViewZones.push({\n\t\t\t\t\tafterLineNumber: 0,\n\t\t\t\t\tdomNode: document.createElement('div'),\n\t\t\t\t\theightInPx: originalTopPaddingVal,\n\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst renderSideBySide = this._options.renderSideBySide.read(reader);\n\n\t\t\tconst deletedCodeLineBreaksComputer = !renderSideBySide ? this._editors.modified._getViewModel()?.createLineBreaksComputer() : undefined;\n\t\t\tif (deletedCodeLineBreaksComputer) {\n\t\t\t\tconst originalModel = this._editors.original.getModel()!;\n\t\t\t\tfor (const a of alignmentsVal) {\n\t\t\t\t\tif (a.diff) {\n\t\t\t\t\t\tfor (let i = a.originalRange.startLineNumber; i < a.originalRange.endLineNumberExclusive; i++) {\n\t\t\t\t\t\t\t// `i` can be out of bound when the diff has not been updated yet.\n\t\t\t\t\t\t\t// In this case, we do an early return.\n\t\t\t\t\t\t\t// TODO@hediet: Fix this by applying the edit directly to the diff model, so that the diff is always valid.\n\t\t\t\t\t\t\tif (i > originalModel.getLineCount()) {\n\t\t\t\t\t\t\t\treturn { orig: origViewZones, mod: modViewZones };\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdeletedCodeLineBreaksComputer?.addRequest(originalModel.getLineContent(i), null, null);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst lineBreakData = deletedCodeLineBreaksComputer?.finalize() ?? [];\n\t\t\tlet lineBreakDataIdx = 0;\n\n\t\t\tconst modLineHeight = this._editors.modified.getOption(EditorOption.lineHeight);\n\n\t\t\tconst syncedMovedText = this._diffModel.read(reader)?.movedTextToCompare.read(reader);\n\n\t\t\tconst mightContainNonBasicASCII = this._editors.original.getModel()?.mightContainNonBasicASCII() ?? false;\n\t\t\tconst mightContainRTL = this._editors.original.getModel()?.mightContainRTL() ?? false;\n\t\t\tconst renderOptions = RenderOptions.fromEditor(this._editors.modified);\n\n\t\t\tfor (const a of alignmentsVal) {\n\t\t\t\tif (a.diff && !renderSideBySide && (!this._options.useTrueInlineDiffRendering.read(reader) || !allowsTrueInlineDiffRendering(a.diff))) {\n\t\t\t\t\tif (!a.originalRange.isEmpty) {\n\t\t\t\t\t\toriginalModelTokenizationCompleted.read(reader); // Update view-zones once tokenization completes\n\n\t\t\t\t\t\tconst deletedCodeDomNode = document.createElement('div');\n\t\t\t\t\t\tdeletedCodeDomNode.classList.add('view-lines', 'line-delete', 'monaco-mouse-cursor-text');\n\t\t\t\t\t\tconst originalModel = this._editors.original.getModel()!;\n\t\t\t\t\t\t// `a.originalRange` can be out of bound when the diff has not been updated yet.\n\t\t\t\t\t\t// In this case, we do an early return.\n\t\t\t\t\t\t// TODO@hediet: Fix this by applying the edit directly to the diff model, so that the diff is always valid.\n\t\t\t\t\t\tif (a.originalRange.endLineNumberExclusive - 1 > originalModel.getLineCount()) {\n\t\t\t\t\t\t\treturn { orig: origViewZones, mod: modViewZones };\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst source = new LineSource(\n\t\t\t\t\t\t\ta.originalRange.mapToLineArray(l => originalModel.tokenization.getLineTokens(l)),\n\t\t\t\t\t\t\ta.originalRange.mapToLineArray(_ => lineBreakData[lineBreakDataIdx++]),\n\t\t\t\t\t\t\tmightContainNonBasicASCII,\n\t\t\t\t\t\t\tmightContainRTL,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst decorations: InlineDecoration[] = [];\n\t\t\t\t\t\tfor (const i of a.diff.innerChanges || []) {\n\t\t\t\t\t\t\tdecorations.push(new InlineDecoration(\n\t\t\t\t\t\t\t\ti.originalRange.delta(-(a.diff.original.startLineNumber - 1)),\n\t\t\t\t\t\t\t\tdiffDeleteDecoration.className!,\n\t\t\t\t\t\t\t\tInlineDecorationType.Regular\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst result = renderLines(source, renderOptions, decorations, deletedCodeDomNode);\n\n\t\t\t\t\t\tconst marginDomNode = document.createElement('div');\n\t\t\t\t\t\tmarginDomNode.className = 'inline-deleted-margin-view-zone';\n\t\t\t\t\t\tapplyFontInfo(marginDomNode, renderOptions.fontInfo);\n\n\t\t\t\t\t\tif (this._options.renderIndicators.read(reader)) {\n\t\t\t\t\t\t\tfor (let i = 0; i < result.heightInLines; i++) {\n\t\t\t\t\t\t\t\tconst marginElement = document.createElement('div');\n\t\t\t\t\t\t\t\tmarginElement.className = `delete-sign ${ThemeIcon.asClassName(diffRemoveIcon)}`;\n\t\t\t\t\t\t\t\tmarginElement.setAttribute('style', `position:absolute;top:${i * modLineHeight}px;width:${renderOptions.lineDecorationsWidth}px;height:${modLineHeight}px;right:0;`);\n\t\t\t\t\t\t\t\tmarginDomNode.appendChild(marginElement);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet zoneId: string | undefined = undefined;\n\t\t\t\t\t\talignmentViewZonesDisposables.add(\n\t\t\t\t\t\t\tnew InlineDiffDeletedCodeMargin(\n\t\t\t\t\t\t\t\t() => assertReturnsDefined(zoneId),\n\t\t\t\t\t\t\t\tmarginDomNode,\n\t\t\t\t\t\t\t\tthis._editors.modified,\n\t\t\t\t\t\t\t\ta.diff,\n\t\t\t\t\t\t\t\tthis._diffEditorWidget,\n\t\t\t\t\t\t\t\tresult.viewLineCounts,\n\t\t\t\t\t\t\t\tthis._editors.original.getModel()!,\n\t\t\t\t\t\t\t\tthis._contextMenuService,\n\t\t\t\t\t\t\t\tthis._clipboardService,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tfor (let i = 0; i < result.viewLineCounts.length; i++) {\n\t\t\t\t\t\t\tconst count = result.viewLineCounts[i];\n\t\t\t\t\t\t\t// Account for wrapped lines in the (collapsed) original editor (which doesn't wrap lines).\n\t\t\t\t\t\t\tif (count > 1) {\n\t\t\t\t\t\t\t\torigViewZones.push({\n\t\t\t\t\t\t\t\t\tafterLineNumber: a.originalRange.startLineNumber + i,\n\t\t\t\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\t\t\t\theightInPx: (count - 1) * modLineHeight,\n\t\t\t\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmodViewZones.push({\n\t\t\t\t\t\t\tafterLineNumber: a.modifiedRange.startLineNumber - 1,\n\t\t\t\t\t\t\tdomNode: deletedCodeDomNode,\n\t\t\t\t\t\t\theightInPx: result.heightInLines * modLineHeight,\n\t\t\t\t\t\t\tminWidthInPx: result.minWidthInPx,\n\t\t\t\t\t\t\tmarginDomNode,\n\t\t\t\t\t\t\tsetZoneId(id) { zoneId = id; },\n\t\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tconst marginDomNode = document.createElement('div');\n\t\t\t\t\tmarginDomNode.className = 'gutter-delete';\n\n\t\t\t\t\torigViewZones.push({\n\t\t\t\t\t\tafterLineNumber: a.originalRange.endLineNumberExclusive - 1,\n\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\theightInPx: a.modifiedHeightInPx,\n\t\t\t\t\t\tmarginDomNode,\n\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tconst delta = a.modifiedHeightInPx - a.originalHeightInPx;\n\t\t\t\t\tif (delta > 0) {\n\t\t\t\t\t\tif (syncedMovedText?.lineRangeMapping.original.delta(-1).deltaLength(2).contains(a.originalRange.endLineNumberExclusive - 1)) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\torigViewZones.push({\n\t\t\t\t\t\t\tafterLineNumber: a.originalRange.endLineNumberExclusive - 1,\n\t\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\t\theightInPx: delta,\n\t\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (syncedMovedText?.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(a.modifiedRange.endLineNumberExclusive - 1)) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction createViewZoneMarginArrow(): HTMLElement {\n\t\t\t\t\t\t\tconst arrow = document.createElement('div');\n\t\t\t\t\t\t\tarrow.className = 'arrow-revert-change ' + ThemeIcon.asClassName(Codicon.arrowRight);\n\t\t\t\t\t\t\treader.store.add(addDisposableListener(arrow, 'mousedown', e => e.stopPropagation()));\n\t\t\t\t\t\t\treader.store.add(addDisposableListener(arrow, 'click', e => {\n\t\t\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\t\t\t_diffEditorWidget.revert(a.diff!);\n\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t\treturn $('div', {}, arrow);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet marginDomNode: HTMLElement | undefined = undefined;\n\t\t\t\t\t\tif (a.diff && a.diff.modified.isEmpty && this._options.shouldRenderOldRevertArrows.read(reader)) {\n\t\t\t\t\t\t\tmarginDomNode = createViewZoneMarginArrow();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmodViewZones.push({\n\t\t\t\t\t\t\tafterLineNumber: a.modifiedRange.endLineNumberExclusive - 1,\n\t\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\t\theightInPx: -delta,\n\t\t\t\t\t\t\tmarginDomNode,\n\t\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (const a of alignmentsSyncedMovedText.read(reader) ?? []) {\n\t\t\t\tif (!syncedMovedText?.lineRangeMapping.original.intersect(a.originalRange)\n\t\t\t\t\t|| !syncedMovedText?.lineRangeMapping.modified.intersect(a.modifiedRange)) {\n\t\t\t\t\t// ignore unrelated alignments outside the synced moved text\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst delta = a.modifiedHeightInPx - a.originalHeightInPx;\n\t\t\t\tif (delta > 0) {\n\t\t\t\t\torigViewZones.push({\n\t\t\t\t\t\tafterLineNumber: a.originalRange.endLineNumberExclusive - 1,\n\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\theightInPx: delta,\n\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tmodViewZones.push({\n\t\t\t\t\t\tafterLineNumber: a.modifiedRange.endLineNumberExclusive - 1,\n\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\theightInPx: -delta,\n\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn { orig: origViewZones, mod: modViewZones };\n\t\t});\n\n\t\tlet ignoreChange = false;\n\t\tthis._register(this._editors.original.onDidScrollChange(e => {\n\t\t\tif (e.scrollLeftChanged && !ignoreChange) {\n\t\t\t\tignoreChange = true;\n\t\t\t\tthis._editors.modified.setScrollLeft(e.scrollLeft);\n\t\t\t\tignoreChange = false;\n\t\t\t}\n\t\t}));\n\t\tthis._register(this._editors.modified.onDidScrollChange(e => {\n\t\t\tif (e.scrollLeftChanged && !ignoreChange) {\n\t\t\t\tignoreChange = true;\n\t\t\t\tthis._editors.original.setScrollLeft(e.scrollLeft);\n\t\t\t\tignoreChange = false;\n\t\t\t}\n\t\t}));\n\n\t\tthis._originalScrollTop = observableFromEvent(this._editors.original.onDidScrollChange, () => /** @description original.getScrollTop */ this._editors.original.getScrollTop());\n\t\tthis._modifiedScrollTop = observableFromEvent(this._editors.modified.onDidScrollChange, () => /** @description modified.getScrollTop */ this._editors.modified.getScrollTop());\n\n\t\t// origExtraHeight + origOffset - origScrollTop = modExtraHeight + modOffset - modScrollTop\n\n\t\t// origScrollTop = origExtraHeight + origOffset - modExtraHeight - modOffset + modScrollTop\n\t\t// modScrollTop = modExtraHeight + modOffset - origExtraHeight - origOffset + origScrollTop\n\n\t\t// origOffset - modOffset = heightOfLines(1..Y) - heightOfLines(1..X)\n\t\t// origScrollTop >= 0, modScrollTop >= 0\n\n\t\tthis._register(autorun(reader => {\n\t\t\t/** @description update scroll modified */\n\t\t\tconst newScrollTopModified = this._originalScrollTop.read(reader)\n\t\t\t\t- (this._originalScrollOffsetAnimated.get() - this._modifiedScrollOffsetAnimated.read(reader))\n\t\t\t\t- (this._originalTopPadding.get() - this._modifiedTopPadding.read(reader));\n\t\t\tif (newScrollTopModified !== this._editors.modified.getScrollTop()) {\n\t\t\t\tthis._editors.modified.setScrollTop(newScrollTopModified, ScrollType.Immediate);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\t/** @description update scroll original */\n\t\t\tconst newScrollTopOriginal = this._modifiedScrollTop.read(reader)\n\t\t\t\t- (this._modifiedScrollOffsetAnimated.get() - this._originalScrollOffsetAnimated.read(reader))\n\t\t\t\t- (this._modifiedTopPadding.get() - this._originalTopPadding.read(reader));\n\t\t\tif (newScrollTopOriginal !== this._editors.original.getScrollTop()) {\n\t\t\t\tthis._editors.original.setScrollTop(newScrollTopOriginal, ScrollType.Immediate);\n\t\t\t}\n\t\t}));\n\n\n\t\tthis._register(autorun(reader => {\n\t\t\t/** @description update editor top offsets */\n\t\t\tconst m = this._diffModel.read(reader)?.movedTextToCompare.read(reader);\n\n\t\t\tlet deltaOrigToMod = 0;\n\t\t\tif (m) {\n\t\t\t\tconst trueTopOriginal = this._editors.original.getTopForLineNumber(m.lineRangeMapping.original.startLineNumber, true) - this._originalTopPadding.get();\n\t\t\t\tconst trueTopModified = this._editors.modified.getTopForLineNumber(m.lineRangeMapping.modified.startLineNumber, true) - this._modifiedTopPadding.get();\n\t\t\t\tdeltaOrigToMod = trueTopModified - trueTopOriginal;\n\t\t\t}\n\n\t\t\tif (deltaOrigToMod > 0) {\n\t\t\t\tthis._modifiedTopPadding.set(0, undefined);\n\t\t\t\tthis._originalTopPadding.set(deltaOrigToMod, undefined);\n\t\t\t} else if (deltaOrigToMod < 0) {\n\t\t\t\tthis._modifiedTopPadding.set(-deltaOrigToMod, undefined);\n\t\t\t\tthis._originalTopPadding.set(0, undefined);\n\t\t\t} else {\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tthis._modifiedTopPadding.set(0, undefined);\n\t\t\t\t\tthis._originalTopPadding.set(0, undefined);\n\t\t\t\t}, 400);\n\t\t\t}\n\n\t\t\tif (this._editors.modified.hasTextFocus()) {\n\t\t\t\tthis._originalScrollOffset.set(this._modifiedScrollOffset.get() - deltaOrigToMod, undefined, true);\n\t\t\t} else {\n\t\t\t\tthis._modifiedScrollOffset.set(this._originalScrollOffset.get() + deltaOrigToMod, undefined, true);\n\t\t\t}\n\t\t}));\n\t}\n}\n\ninterface ILineRangeAlignment {\n\toriginalRange: LineRange;\n\tmodifiedRange: LineRange;\n\n\t// accounts for foreign viewzones and line wrapping\n\toriginalHeightInPx: number;\n\tmodifiedHeightInPx: number;\n\n\t/**\n\t * If this range alignment is a direct result of a diff, then this is the diff's line mapping.\n\t * Only used for inline-view.\n\t */\n\tdiff?: DetailedLineRangeMapping;\n}\n\nfunction computeRangeAlignment(\n\toriginalEditor: CodeEditorWidget,\n\tmodifiedEditor: CodeEditorWidget,\n\tdiffs: readonly DiffMapping[],\n\toriginalEditorAlignmentViewZones: ReadonlySet<string>,\n\tmodifiedEditorAlignmentViewZones: ReadonlySet<string>,\n\tinnerHunkAlignment: boolean,\n): ILineRangeAlignment[] {\n\tconst originalLineHeightOverrides = new ArrayQueue(getAdditionalLineHeights(originalEditor, originalEditorAlignmentViewZones));\n\tconst modifiedLineHeightOverrides = new ArrayQueue(getAdditionalLineHeights(modifiedEditor, modifiedEditorAlignmentViewZones));\n\n\tconst origLineHeight = originalEditor.getOption(EditorOption.lineHeight);\n\tconst modLineHeight = modifiedEditor.getOption(EditorOption.lineHeight);\n\n\tconst result: ILineRangeAlignment[] = [];\n\n\tlet lastOriginalLineNumber = 0;\n\tlet lastModifiedLineNumber = 0;\n\n\tfunction handleAlignmentsOutsideOfDiffs(untilOriginalLineNumberExclusive: number, untilModifiedLineNumberExclusive: number) {\n\t\twhile (true) {\n\t\t\tlet origNext = originalLineHeightOverrides.peek();\n\t\t\tlet modNext = modifiedLineHeightOverrides.peek();\n\t\t\tif (origNext && origNext.lineNumber >= untilOriginalLineNumberExclusive) {\n\t\t\t\torigNext = undefined;\n\t\t\t}\n\t\t\tif (modNext && modNext.lineNumber >= untilModifiedLineNumberExclusive) {\n\t\t\t\tmodNext = undefined;\n\t\t\t}\n\t\t\tif (!origNext && !modNext) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst distOrig = origNext ? origNext.lineNumber - lastOriginalLineNumber : Number.MAX_VALUE;\n\t\t\tconst distNext = modNext ? modNext.lineNumber - lastModifiedLineNumber : Number.MAX_VALUE;\n\n\t\t\tif (distOrig < distNext) {\n\t\t\t\toriginalLineHeightOverrides.dequeue();\n\t\t\t\tmodNext = {\n\t\t\t\t\tlineNumber: origNext!.lineNumber - lastOriginalLineNumber + lastModifiedLineNumber,\n\t\t\t\t\theightInPx: 0,\n\t\t\t\t};\n\t\t\t} else if (distOrig > distNext) {\n\t\t\t\tmodifiedLineHeightOverrides.dequeue();\n\t\t\t\torigNext = {\n\t\t\t\t\tlineNumber: modNext!.lineNumber - lastModifiedLineNumber + lastOriginalLineNumber,\n\t\t\t\t\theightInPx: 0,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\toriginalLineHeightOverrides.dequeue();\n\t\t\t\tmodifiedLineHeightOverrides.dequeue();\n\t\t\t}\n\n\t\t\tresult.push({\n\t\t\t\toriginalRange: LineRange.ofLength(origNext!.lineNumber, 1),\n\t\t\t\tmodifiedRange: LineRange.ofLength(modNext!.lineNumber, 1),\n\t\t\t\toriginalHeightInPx: origLineHeight + origNext!.heightInPx,\n\t\t\t\tmodifiedHeightInPx: modLineHeight + modNext!.heightInPx,\n\t\t\t\tdiff: undefined,\n\t\t\t});\n\t\t}\n\t}\n\n\tfor (const m of diffs) {\n\t\tconst c = m.lineRangeMapping;\n\t\thandleAlignmentsOutsideOfDiffs(c.original.startLineNumber, c.modified.startLineNumber);\n\n\t\tlet first = true;\n\t\tlet lastModLineNumber = c.modified.startLineNumber;\n\t\tlet lastOrigLineNumber = c.original.startLineNumber;\n\n\t\tfunction emitAlignment(origLineNumberExclusive: number, modLineNumberExclusive: number, forceAlignment = false) {\n\t\t\tif (origLineNumberExclusive < lastOrigLineNumber || modLineNumberExclusive < lastModLineNumber) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (first) {\n\t\t\t\tfirst = false;\n\t\t\t} else if (!forceAlignment && (origLineNumberExclusive === lastOrigLineNumber || modLineNumberExclusive === lastModLineNumber)) {\n\t\t\t\t// This causes a re-alignment of an already aligned line.\n\t\t\t\t// However, we don't care for the final alignment.\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst originalRange = new LineRange(lastOrigLineNumber, origLineNumberExclusive);\n\t\t\tconst modifiedRange = new LineRange(lastModLineNumber, modLineNumberExclusive);\n\t\t\tif (originalRange.isEmpty && modifiedRange.isEmpty) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst originalAdditionalHeight = originalLineHeightOverrides\n\t\t\t\t.takeWhile(v => v.lineNumber < origLineNumberExclusive)\n\t\t\t\t?.reduce((p, c) => p + c.heightInPx, 0) ?? 0;\n\t\t\tconst modifiedAdditionalHeight = modifiedLineHeightOverrides\n\t\t\t\t.takeWhile(v => v.lineNumber < modLineNumberExclusive)\n\t\t\t\t?.reduce((p, c) => p + c.heightInPx, 0) ?? 0;\n\n\t\t\tresult.push({\n\t\t\t\toriginalRange,\n\t\t\t\tmodifiedRange,\n\t\t\t\toriginalHeightInPx: originalRange.length * origLineHeight + originalAdditionalHeight,\n\t\t\t\tmodifiedHeightInPx: modifiedRange.length * modLineHeight + modifiedAdditionalHeight,\n\t\t\t\tdiff: m.lineRangeMapping,\n\t\t\t});\n\n\t\t\tlastOrigLineNumber = origLineNumberExclusive;\n\t\t\tlastModLineNumber = modLineNumberExclusive;\n\t\t}\n\n\t\tif (innerHunkAlignment) {\n\t\t\tfor (const i of c.innerChanges || []) {\n\t\t\t\tif (i.originalRange.startColumn > 1 && i.modifiedRange.startColumn > 1) {\n\t\t\t\t\t// There is some unmodified text on this line before the diff\n\t\t\t\t\temitAlignment(i.originalRange.startLineNumber, i.modifiedRange.startLineNumber);\n\t\t\t\t}\n\t\t\t\tconst originalModel = originalEditor.getModel()!;\n\t\t\t\t// When the diff is invalid, the ranges might be out of bounds (this should be fixed in the diff model by applying edits directly).\n\t\t\t\tconst maxColumn = i.originalRange.endLineNumber <= originalModel.getLineCount() ? originalModel.getLineMaxColumn(i.originalRange.endLineNumber) : Number.MAX_SAFE_INTEGER;\n\t\t\t\tif (i.originalRange.endColumn < maxColumn) {\n\t\t\t\t\t// // There is some unmodified text on this line after the diff\n\t\t\t\t\temitAlignment(i.originalRange.endLineNumber, i.modifiedRange.endLineNumber);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\temitAlignment(c.original.endLineNumberExclusive, c.modified.endLineNumberExclusive, true);\n\n\t\tlastOriginalLineNumber = c.original.endLineNumberExclusive;\n\t\tlastModifiedLineNumber = c.modified.endLineNumberExclusive;\n\t}\n\thandleAlignmentsOutsideOfDiffs(Number.MAX_VALUE, Number.MAX_VALUE);\n\n\treturn result;\n}\n\ninterface AdditionalLineHeightInfo {\n\tlineNumber: number;\n\theightInPx: number;\n}\n\nfunction getAdditionalLineHeights(editor: CodeEditorWidget, viewZonesToIgnore: ReadonlySet<string>): readonly AdditionalLineHeightInfo[] {\n\tconst viewZoneHeights: { lineNumber: number; heightInPx: number }[] = [];\n\tconst wrappingZoneHeights: { lineNumber: number; heightInPx: number }[] = [];\n\n\tconst hasWrapping = editor.getOption(EditorOption.wrappingInfo).wrappingColumn !== -1;\n\tconst coordinatesConverter = editor._getViewModel()!.coordinatesConverter;\n\tconst editorLineHeight = editor.getOption(EditorOption.lineHeight);\n\tif (hasWrapping) {\n\t\tfor (let i = 1; i <= editor.getModel()!.getLineCount(); i++) {\n\t\t\tconst lineCount = coordinatesConverter.getModelLineViewLineCount(i);\n\t\t\tif (lineCount > 1) {\n\t\t\t\twrappingZoneHeights.push({ lineNumber: i, heightInPx: editorLineHeight * (lineCount - 1) });\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (const w of editor.getWhitespaces()) {\n\t\tif (viewZonesToIgnore.has(w.id)) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst modelLineNumber = w.afterLineNumber === 0 ? 0 : coordinatesConverter.convertViewPositionToModelPosition(\n\t\t\tnew Position(w.afterLineNumber, 1)\n\t\t).lineNumber;\n\t\tviewZoneHeights.push({ lineNumber: modelLineNumber, heightInPx: w.height });\n\t}\n\n\tconst result = joinCombine(\n\t\tviewZoneHeights,\n\t\twrappingZoneHeights,\n\t\tv => v.lineNumber,\n\t\t(v1, v2) => ({ lineNumber: v1.lineNumber, heightInPx: v1.heightInPx + v2.heightInPx })\n\t);\n\n\treturn result;\n}\n\nexport function allowsTrueInlineDiffRendering(mapping: DetailedLineRangeMapping): boolean {\n\tif (!mapping.innerChanges) {\n\t\treturn false;\n\t}\n\treturn mapping.innerChanges.every(c =>\n\t\t(rangeIsSingleLine(c.modifiedRange) && rangeIsSingleLine(c.originalRange))\n\t\t|| c.originalRange.equalsRange(new Range(1, 1, 1, 1))\n\t);\n}\n\nexport function rangeIsSingleLine(range: Range): boolean {\n\treturn range.startLineNumber === range.endLineNumber;\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.ts","vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAAE,CAAC,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AACzF,OAAO,EAAe,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAClI,OAAO,EAAE,SAAS,EAAE,MAAM,4CAA4C,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAElE,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAE3F,OAAO,EAAuB,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAEhF,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAuB,kBAAkB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEtF,OAAO,EAAE,SAAS,EAAE,MAAM,gDAAgD,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CA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C,KAAK,CAAC,CAAC,CAAC,EAAE,CACrC,CAAC,iBAAiB,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,iBAAiB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC;WACvE,CAAC,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CACrD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAY;IAC7C,OAAO,KAAK,CAAC,eAAe,KAAK,KAAK,CAAC,aAAa,CAAC;AACtD,CAAC","file":"diffEditorViewZones.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { $, addDisposableListener } from '../../../../../../base/browser/dom.js';\nimport { ArrayQueue } from '../../../../../../base/common/arrays.js';\nimport { RunOnceScheduler } from '../../../../../../base/common/async.js';\nimport { Codicon } from '../../../../../../base/common/codicons.js';\nimport { Disposable, DisposableStore } from '../../../../../../base/common/lifecycle.js';\nimport { IObservable, autorun, derived, observableFromEvent, observableValue } from '../../../../../../base/common/observable.js';\nimport { ThemeIcon } from '../../../../../../base/common/themables.js';\nimport { assertReturnsDefined } from '../../../../../../base/common/types.js';\nimport { applyFontInfo } from '../../../../config/domFontInfo.js';\nimport { CodeEditorWidget } from '../../../codeEditor/codeEditorWidget.js';\nimport { diffDeleteDecoration, diffRemoveIcon } from '../../registrations.contribution.js';\nimport { DiffEditorEditors } from '../diffEditorEditors.js';\nimport { DiffEditorViewModel, DiffMapping } from '../../diffEditorViewModel.js';\nimport { DiffEditorWidget } from '../../diffEditorWidget.js';\nimport { InlineDiffDeletedCodeMargin } from './inlineDiffDeletedCodeMargin.js';\nimport { LineSource, RenderOptions, renderLines } from './renderLines.js';\nimport { IObservableViewZone, animatedObservable, joinCombine } from '../../utils.js';\nimport { EditorOption } from '../../../../../common/config/editorOptions.js';\nimport { LineRange } from '../../../../../common/core/ranges/lineRange.js';\nimport { Position } from '../../../../../common/core/position.js';\nimport { DetailedLineRangeMapping } from '../../../../../common/diff/rangeMapping.js';\nimport { ScrollType } from '../../../../../common/editorCommon.js';\nimport { BackgroundTokenizationState } from '../../../../../common/tokenizationTextModelPart.js';\nimport { IClipboardService } from '../../../../../../platform/clipboard/common/clipboardService.js';\nimport { IContextMenuService } from '../../../../../../platform/contextview/browser/contextView.js';\nimport { DiffEditorOptions } from '../../diffEditorOptions.js';\nimport { Range } from '../../../../../common/core/range.js';\nimport { InlineDecoration, InlineDecorationType } from '../../../../../common/viewModel/inlineDecorations.js';\n\n/**\n * Ensures both editors have the same height by aligning unchanged lines.\n * In inline view mode, inserts viewzones to show deleted code from the original text model in the modified code editor.\n * Synchronizes scrolling.\n *\n * Make sure to add the view zones!\n */\nexport class DiffEditorViewZones extends Disposable {\n\tprivate readonly _originalTopPadding;\n\tprivate readonly _originalScrollTop: IObservable<number>;\n\tprivate readonly _originalScrollOffset;\n\tprivate readonly _originalScrollOffsetAnimated;\n\n\tprivate readonly _modifiedTopPadding;\n\tprivate readonly _modifiedScrollTop: IObservable<number>;\n\tprivate readonly _modifiedScrollOffset;\n\tprivate readonly _modifiedScrollOffsetAnimated;\n\n\tpublic readonly viewZones: IObservable<{ orig: IObservableViewZone[]; mod: IObservableViewZone[] }>;\n\n\tconstructor(\n\t\tprivate readonly _targetWindow: Window,\n\t\tprivate readonly _editors: DiffEditorEditors,\n\t\tprivate readonly _diffModel: IObservable<DiffEditorViewModel | undefined>,\n\t\tprivate readonly _options: DiffEditorOptions,\n\t\tprivate readonly _diffEditorWidget: DiffEditorWidget,\n\t\tprivate readonly _canIgnoreViewZoneUpdateEvent: () => boolean,\n\t\tprivate readonly _origViewZonesToIgnore: Set<string>,\n\t\tprivate readonly _modViewZonesToIgnore: Set<string>,\n\t\t@IClipboardService private readonly _clipboardService: IClipboardService,\n\t\t@IContextMenuService private readonly _contextMenuService: IContextMenuService,\n\t) {\n\t\tsuper();\n\t\tthis._originalTopPadding = observableValue(this, 0);\n\t\tthis._originalScrollOffset = observableValue<number, boolean>(this, 0);\n\t\tthis._originalScrollOffsetAnimated = animatedObservable(this._targetWindow, this._originalScrollOffset, this._store);\n\t\tthis._modifiedTopPadding = observableValue(this, 0);\n\t\tthis._modifiedScrollOffset = observableValue<number, boolean>(this, 0);\n\t\tthis._modifiedScrollOffsetAnimated = animatedObservable(this._targetWindow, this._modifiedScrollOffset, this._store);\n\n\t\tconst state = observableValue('invalidateAlignmentsState', 0);\n\n\t\tconst updateImmediately = this._register(new RunOnceScheduler(() => {\n\t\t\tstate.set(state.get() + 1, undefined);\n\t\t}, 0));\n\n\t\tthis._register(this._editors.original.onDidChangeViewZones((_args) => { if (!this._canIgnoreViewZoneUpdateEvent()) { updateImmediately.schedule(); } }));\n\t\tthis._register(this._editors.modified.onDidChangeViewZones((_args) => { if (!this._canIgnoreViewZoneUpdateEvent()) { updateImmediately.schedule(); } }));\n\t\tthis._register(this._editors.original.onDidChangeConfiguration((args) => {\n\t\t\tif (args.hasChanged(EditorOption.wrappingInfo) || args.hasChanged(EditorOption.lineHeight)) { updateImmediately.schedule(); }\n\t\t}));\n\t\tthis._register(this._editors.modified.onDidChangeConfiguration((args) => {\n\t\t\tif (args.hasChanged(EditorOption.wrappingInfo) || args.hasChanged(EditorOption.lineHeight)) { updateImmediately.schedule(); }\n\t\t}));\n\n\t\tconst originalModelTokenizationCompleted = this._diffModel.map(m =>\n\t\t\tm ? observableFromEvent(this, m.model.original.onDidChangeTokens, () => m.model.original.tokenization.backgroundTokenizationState === BackgroundTokenizationState.Completed) : undefined\n\t\t).map((m, reader) => m?.read(reader));\n\n\t\tconst alignments = derived<ILineRangeAlignment[] | null>((reader) => {\n\t\t\t/** @description alignments */\n\t\t\tconst diffModel = this._diffModel.read(reader);\n\t\t\tconst diff = diffModel?.diff.read(reader);\n\t\t\tif (!diffModel || !diff) { return null; }\n\t\t\tstate.read(reader);\n\t\t\tconst renderSideBySide = this._options.renderSideBySide.read(reader);\n\t\t\tconst innerHunkAlignment = renderSideBySide;\n\t\t\treturn computeRangeAlignment(\n\t\t\t\tthis._editors.original,\n\t\t\t\tthis._editors.modified,\n\t\t\t\tdiff.mappings,\n\t\t\t\tthis._origViewZonesToIgnore,\n\t\t\t\tthis._modViewZonesToIgnore,\n\t\t\t\tinnerHunkAlignment\n\t\t\t);\n\t\t});\n\n\t\tconst alignmentsSyncedMovedText = derived<ILineRangeAlignment[] | null>((reader) => {\n\t\t\t/** @description alignmentsSyncedMovedText */\n\t\t\tconst syncedMovedText = this._diffModel.read(reader)?.movedTextToCompare.read(reader);\n\t\t\tif (!syncedMovedText) { return null; }\n\t\t\tstate.read(reader);\n\t\t\tconst mappings = syncedMovedText.changes.map(c => new DiffMapping(c));\n\t\t\t// TODO dont include alignments outside syncedMovedText\n\t\t\treturn computeRangeAlignment(\n\t\t\t\tthis._editors.original,\n\t\t\t\tthis._editors.modified,\n\t\t\t\tmappings,\n\t\t\t\tthis._origViewZonesToIgnore,\n\t\t\t\tthis._modViewZonesToIgnore,\n\t\t\t\ttrue\n\t\t\t);\n\t\t});\n\n\t\tfunction createFakeLinesDiv(): HTMLElement {\n\t\t\tconst r = document.createElement('div');\n\t\t\tr.className = 'diagonal-fill';\n\t\t\treturn r;\n\t\t}\n\n\t\tconst alignmentViewZonesDisposables = this._register(new DisposableStore());\n\t\tthis.viewZones = derived<{ orig: IObservableViewZone[]; mod: IObservableViewZone[] }>(this, (reader) => {\n\t\t\talignmentViewZonesDisposables.clear();\n\n\t\t\tconst alignmentsVal = alignments.read(reader) || [];\n\n\t\t\tconst origViewZones: IObservableViewZone[] = [];\n\t\t\tconst modViewZones: IObservableViewZone[] = [];\n\n\t\t\tconst modifiedTopPaddingVal = this._modifiedTopPadding.read(reader);\n\t\t\tif (modifiedTopPaddingVal > 0) {\n\t\t\t\tmodViewZones.push({\n\t\t\t\t\tafterLineNumber: 0,\n\t\t\t\t\tdomNode: document.createElement('div'),\n\t\t\t\t\theightInPx: modifiedTopPaddingVal,\n\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst originalTopPaddingVal = this._originalTopPadding.read(reader);\n\t\t\tif (originalTopPaddingVal > 0) {\n\t\t\t\torigViewZones.push({\n\t\t\t\t\tafterLineNumber: 0,\n\t\t\t\t\tdomNode: document.createElement('div'),\n\t\t\t\t\theightInPx: originalTopPaddingVal,\n\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst renderSideBySide = this._options.renderSideBySide.read(reader);\n\n\t\t\tconst deletedCodeLineBreaksComputer = !renderSideBySide ? this._editors.modified._getViewModel()?.createLineBreaksComputer() : undefined;\n\t\t\tif (deletedCodeLineBreaksComputer) {\n\t\t\t\tconst originalModel = this._editors.original.getModel()!;\n\t\t\t\tfor (const a of alignmentsVal) {\n\t\t\t\t\tif (a.diff) {\n\t\t\t\t\t\tfor (let i = a.originalRange.startLineNumber; i < a.originalRange.endLineNumberExclusive; i++) {\n\t\t\t\t\t\t\t// `i` can be out of bound when the diff has not been updated yet.\n\t\t\t\t\t\t\t// In this case, we do an early return.\n\t\t\t\t\t\t\t// TODO@hediet: Fix this by applying the edit directly to the diff model, so that the diff is always valid.\n\t\t\t\t\t\t\tif (i > originalModel.getLineCount()) {\n\t\t\t\t\t\t\t\treturn { orig: origViewZones, mod: modViewZones };\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdeletedCodeLineBreaksComputer?.addRequest(originalModel.getLineContent(i), null, null);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst lineBreakData = deletedCodeLineBreaksComputer?.finalize() ?? [];\n\t\t\tlet lineBreakDataIdx = 0;\n\n\t\t\tconst modLineHeight = this._editors.modified.getOption(EditorOption.lineHeight);\n\n\t\t\tconst syncedMovedText = this._diffModel.read(reader)?.movedTextToCompare.read(reader);\n\n\t\t\tconst mightContainNonBasicASCII = this._editors.original.getModel()?.mightContainNonBasicASCII() ?? false;\n\t\t\tconst mightContainRTL = this._editors.original.getModel()?.mightContainRTL() ?? false;\n\t\t\tconst renderOptions = RenderOptions.fromEditor(this._editors.modified);\n\n\t\t\tfor (const a of alignmentsVal) {\n\t\t\t\tif (a.diff && !renderSideBySide && (!this._options.useTrueInlineDiffRendering.read(reader) || !allowsTrueInlineDiffRendering(a.diff))) {\n\t\t\t\t\tif (!a.originalRange.isEmpty) {\n\t\t\t\t\t\toriginalModelTokenizationCompleted.read(reader); // Update view-zones once tokenization completes\n\n\t\t\t\t\t\tconst deletedCodeDomNode = document.createElement('div');\n\t\t\t\t\t\tdeletedCodeDomNode.classList.add('view-lines', 'line-delete', 'monaco-mouse-cursor-text');\n\t\t\t\t\t\tconst originalModel = this._editors.original.getModel()!;\n\t\t\t\t\t\t// `a.originalRange` can be out of bound when the diff has not been updated yet.\n\t\t\t\t\t\t// In this case, we do an early return.\n\t\t\t\t\t\t// TODO@hediet: Fix this by applying the edit directly to the diff model, so that the diff is always valid.\n\t\t\t\t\t\tif (a.originalRange.endLineNumberExclusive - 1 > originalModel.getLineCount()) {\n\t\t\t\t\t\t\treturn { orig: origViewZones, mod: modViewZones };\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst source = new LineSource(\n\t\t\t\t\t\t\ta.originalRange.mapToLineArray(l => originalModel.tokenization.getLineTokens(l)),\n\t\t\t\t\t\t\ta.originalRange.mapToLineArray(_ => lineBreakData[lineBreakDataIdx++]),\n\t\t\t\t\t\t\tmightContainNonBasicASCII,\n\t\t\t\t\t\t\tmightContainRTL,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst decorations: InlineDecoration[] = [];\n\t\t\t\t\t\tfor (const i of a.diff.innerChanges || []) {\n\t\t\t\t\t\t\tdecorations.push(new InlineDecoration(\n\t\t\t\t\t\t\t\ti.originalRange.delta(-(a.diff.original.startLineNumber - 1)),\n\t\t\t\t\t\t\t\tdiffDeleteDecoration.className!,\n\t\t\t\t\t\t\t\tInlineDecorationType.Regular\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst result = renderLines(source, renderOptions, decorations, deletedCodeDomNode);\n\n\t\t\t\t\t\tconst marginDomNode = document.createElement('div');\n\t\t\t\t\t\tmarginDomNode.className = 'inline-deleted-margin-view-zone';\n\t\t\t\t\t\tapplyFontInfo(marginDomNode, renderOptions.fontInfo);\n\n\t\t\t\t\t\tif (this._options.renderIndicators.read(reader)) {\n\t\t\t\t\t\t\tfor (let i = 0; i < result.heightInLines; i++) {\n\t\t\t\t\t\t\t\tconst marginElement = document.createElement('div');\n\t\t\t\t\t\t\t\tmarginElement.className = `delete-sign ${ThemeIcon.asClassName(diffRemoveIcon)}`;\n\t\t\t\t\t\t\t\tmarginElement.setAttribute('style', `position:absolute;top:${i * modLineHeight}px;width:${renderOptions.lineDecorationsWidth}px;height:${modLineHeight}px;right:0;`);\n\t\t\t\t\t\t\t\tmarginDomNode.appendChild(marginElement);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet zoneId: string | undefined = undefined;\n\t\t\t\t\t\talignmentViewZonesDisposables.add(\n\t\t\t\t\t\t\tnew InlineDiffDeletedCodeMargin(\n\t\t\t\t\t\t\t\t() => assertReturnsDefined(zoneId),\n\t\t\t\t\t\t\t\tmarginDomNode,\n\t\t\t\t\t\t\t\tthis._editors.modified,\n\t\t\t\t\t\t\t\ta.diff,\n\t\t\t\t\t\t\t\tthis._diffEditorWidget,\n\t\t\t\t\t\t\t\tresult.viewLineCounts,\n\t\t\t\t\t\t\t\tthis._editors.original.getModel()!,\n\t\t\t\t\t\t\t\tthis._contextMenuService,\n\t\t\t\t\t\t\t\tthis._clipboardService,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tfor (let i = 0; i < result.viewLineCounts.length; i++) {\n\t\t\t\t\t\t\tconst count = result.viewLineCounts[i];\n\t\t\t\t\t\t\t// Account for wrapped lines in the (collapsed) original editor (which doesn't wrap lines).\n\t\t\t\t\t\t\tif (count > 1) {\n\t\t\t\t\t\t\t\torigViewZones.push({\n\t\t\t\t\t\t\t\t\tafterLineNumber: a.originalRange.startLineNumber + i,\n\t\t\t\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\t\t\t\theightInPx: (count - 1) * modLineHeight,\n\t\t\t\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmodViewZones.push({\n\t\t\t\t\t\t\tafterLineNumber: a.modifiedRange.startLineNumber - 1,\n\t\t\t\t\t\t\tdomNode: deletedCodeDomNode,\n\t\t\t\t\t\t\theightInPx: result.heightInLines * modLineHeight,\n\t\t\t\t\t\t\tminWidthInPx: result.minWidthInPx,\n\t\t\t\t\t\t\tmarginDomNode,\n\t\t\t\t\t\t\tsetZoneId(id) { zoneId = id; },\n\t\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tconst marginDomNode = document.createElement('div');\n\t\t\t\t\tmarginDomNode.className = 'gutter-delete';\n\n\t\t\t\t\torigViewZones.push({\n\t\t\t\t\t\tafterLineNumber: a.originalRange.endLineNumberExclusive - 1,\n\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\theightInPx: a.modifiedHeightInPx,\n\t\t\t\t\t\tmarginDomNode,\n\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tconst delta = a.modifiedHeightInPx - a.originalHeightInPx;\n\t\t\t\t\tif (delta > 0) {\n\t\t\t\t\t\tif (syncedMovedText?.lineRangeMapping.original.delta(-1).deltaLength(2).contains(a.originalRange.endLineNumberExclusive - 1)) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\torigViewZones.push({\n\t\t\t\t\t\t\tafterLineNumber: a.originalRange.endLineNumberExclusive - 1,\n\t\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\t\theightInPx: delta,\n\t\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (syncedMovedText?.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(a.modifiedRange.endLineNumberExclusive - 1)) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction createViewZoneMarginArrow(): HTMLElement {\n\t\t\t\t\t\t\tconst arrow = document.createElement('div');\n\t\t\t\t\t\t\tarrow.className = 'arrow-revert-change ' + ThemeIcon.asClassName(Codicon.arrowRight);\n\t\t\t\t\t\t\treader.store.add(addDisposableListener(arrow, 'mousedown', e => e.stopPropagation()));\n\t\t\t\t\t\t\treader.store.add(addDisposableListener(arrow, 'click', e => {\n\t\t\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\t\t\t_diffEditorWidget.revert(a.diff!);\n\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t\treturn $('div', {}, arrow);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet marginDomNode: HTMLElement | undefined = undefined;\n\t\t\t\t\t\tif (a.diff && a.diff.modified.isEmpty && this._options.shouldRenderOldRevertArrows.read(reader)) {\n\t\t\t\t\t\t\tmarginDomNode = createViewZoneMarginArrow();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmodViewZones.push({\n\t\t\t\t\t\t\tafterLineNumber: a.modifiedRange.endLineNumberExclusive - 1,\n\t\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\t\theightInPx: -delta,\n\t\t\t\t\t\t\tmarginDomNode,\n\t\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (const a of alignmentsSyncedMovedText.read(reader) ?? []) {\n\t\t\t\tif (!syncedMovedText?.lineRangeMapping.original.intersect(a.originalRange)\n\t\t\t\t\t|| !syncedMovedText?.lineRangeMapping.modified.intersect(a.modifiedRange)) {\n\t\t\t\t\t// ignore unrelated alignments outside the synced moved text\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst delta = a.modifiedHeightInPx - a.originalHeightInPx;\n\t\t\t\tif (delta > 0) {\n\t\t\t\t\torigViewZones.push({\n\t\t\t\t\t\tafterLineNumber: a.originalRange.endLineNumberExclusive - 1,\n\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\theightInPx: delta,\n\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tmodViewZones.push({\n\t\t\t\t\t\tafterLineNumber: a.modifiedRange.endLineNumberExclusive - 1,\n\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\theightInPx: -delta,\n\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn { orig: origViewZones, mod: modViewZones };\n\t\t});\n\n\t\tlet ignoreChange = false;\n\t\tthis._register(this._editors.original.onDidScrollChange(e => {\n\t\t\tif (e.scrollLeftChanged && !ignoreChange) {\n\t\t\t\tignoreChange = true;\n\t\t\t\tthis._editors.modified.setScrollLeft(e.scrollLeft);\n\t\t\t\tignoreChange = false;\n\t\t\t}\n\t\t}));\n\t\tthis._register(this._editors.modified.onDidScrollChange(e => {\n\t\t\tif (e.scrollLeftChanged && !ignoreChange) {\n\t\t\t\tignoreChange = true;\n\t\t\t\tthis._editors.original.setScrollLeft(e.scrollLeft);\n\t\t\t\tignoreChange = false;\n\t\t\t}\n\t\t}));\n\n\t\tthis._originalScrollTop = observableFromEvent(this._editors.original.onDidScrollChange, () => /** @description original.getScrollTop */ this._editors.original.getScrollTop());\n\t\tthis._modifiedScrollTop = observableFromEvent(this._editors.modified.onDidScrollChange, () => /** @description modified.getScrollTop */ this._editors.modified.getScrollTop());\n\n\t\t// origExtraHeight + origOffset - origScrollTop = modExtraHeight + modOffset - modScrollTop\n\n\t\t// origScrollTop = origExtraHeight + origOffset - modExtraHeight - modOffset + modScrollTop\n\t\t// modScrollTop = modExtraHeight + modOffset - origExtraHeight - origOffset + origScrollTop\n\n\t\t// origOffset - modOffset = heightOfLines(1..Y) - heightOfLines(1..X)\n\t\t// origScrollTop >= 0, modScrollTop >= 0\n\n\t\tthis._register(autorun(reader => {\n\t\t\t/** @description update scroll modified */\n\t\t\tconst newScrollTopModified = this._originalScrollTop.read(reader)\n\t\t\t\t- (this._originalScrollOffsetAnimated.read(undefined) - this._modifiedScrollOffsetAnimated.read(reader))\n\t\t\t\t- (this._originalTopPadding.read(undefined) - this._modifiedTopPadding.read(reader));\n\t\t\tif (newScrollTopModified !== this._editors.modified.getScrollTop()) {\n\t\t\t\tthis._editors.modified.setScrollTop(newScrollTopModified, ScrollType.Immediate);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\t/** @description update scroll original */\n\t\t\tconst newScrollTopOriginal = this._modifiedScrollTop.read(reader)\n\t\t\t\t- (this._modifiedScrollOffsetAnimated.read(undefined) - this._originalScrollOffsetAnimated.read(reader))\n\t\t\t\t- (this._modifiedTopPadding.read(undefined) - this._originalTopPadding.read(reader));\n\t\t\tif (newScrollTopOriginal !== this._editors.original.getScrollTop()) {\n\t\t\t\tthis._editors.original.setScrollTop(newScrollTopOriginal, ScrollType.Immediate);\n\t\t\t}\n\t\t}));\n\n\n\t\tthis._register(autorun(reader => {\n\t\t\t/** @description update editor top offsets */\n\t\t\tconst m = this._diffModel.read(reader)?.movedTextToCompare.read(reader);\n\n\t\t\tlet deltaOrigToMod = 0;\n\t\t\tif (m) {\n\t\t\t\tconst trueTopOriginal = this._editors.original.getTopForLineNumber(m.lineRangeMapping.original.startLineNumber, true) - this._originalTopPadding.read(undefined);\n\t\t\t\tconst trueTopModified = this._editors.modified.getTopForLineNumber(m.lineRangeMapping.modified.startLineNumber, true) - this._modifiedTopPadding.read(undefined);\n\t\t\t\tdeltaOrigToMod = trueTopModified - trueTopOriginal;\n\t\t\t}\n\n\t\t\tif (deltaOrigToMod > 0) {\n\t\t\t\tthis._modifiedTopPadding.set(0, undefined);\n\t\t\t\tthis._originalTopPadding.set(deltaOrigToMod, undefined);\n\t\t\t} else if (deltaOrigToMod < 0) {\n\t\t\t\tthis._modifiedTopPadding.set(-deltaOrigToMod, undefined);\n\t\t\t\tthis._originalTopPadding.set(0, undefined);\n\t\t\t} else {\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tthis._modifiedTopPadding.set(0, undefined);\n\t\t\t\t\tthis._originalTopPadding.set(0, undefined);\n\t\t\t\t}, 400);\n\t\t\t}\n\n\t\t\tif (this._editors.modified.hasTextFocus()) {\n\t\t\t\tthis._originalScrollOffset.set(this._modifiedScrollOffset.read(undefined) - deltaOrigToMod, undefined, true);\n\t\t\t} else {\n\t\t\t\tthis._modifiedScrollOffset.set(this._originalScrollOffset.read(undefined) + deltaOrigToMod, undefined, true);\n\t\t\t}\n\t\t}));\n\t}\n}\n\ninterface ILineRangeAlignment {\n\toriginalRange: LineRange;\n\tmodifiedRange: LineRange;\n\n\t// accounts for foreign viewzones and line wrapping\n\toriginalHeightInPx: number;\n\tmodifiedHeightInPx: number;\n\n\t/**\n\t * If this range alignment is a direct result of a diff, then this is the diff's line mapping.\n\t * Only used for inline-view.\n\t */\n\tdiff?: DetailedLineRangeMapping;\n}\n\nfunction computeRangeAlignment(\n\toriginalEditor: CodeEditorWidget,\n\tmodifiedEditor: CodeEditorWidget,\n\tdiffs: readonly DiffMapping[],\n\toriginalEditorAlignmentViewZones: ReadonlySet<string>,\n\tmodifiedEditorAlignmentViewZones: ReadonlySet<string>,\n\tinnerHunkAlignment: boolean,\n): ILineRangeAlignment[] {\n\tconst originalLineHeightOverrides = new ArrayQueue(getAdditionalLineHeights(originalEditor, originalEditorAlignmentViewZones));\n\tconst modifiedLineHeightOverrides = new ArrayQueue(getAdditionalLineHeights(modifiedEditor, modifiedEditorAlignmentViewZones));\n\n\tconst origLineHeight = originalEditor.getOption(EditorOption.lineHeight);\n\tconst modLineHeight = modifiedEditor.getOption(EditorOption.lineHeight);\n\n\tconst result: ILineRangeAlignment[] = [];\n\n\tlet lastOriginalLineNumber = 0;\n\tlet lastModifiedLineNumber = 0;\n\n\tfunction handleAlignmentsOutsideOfDiffs(untilOriginalLineNumberExclusive: number, untilModifiedLineNumberExclusive: number) {\n\t\twhile (true) {\n\t\t\tlet origNext = originalLineHeightOverrides.peek();\n\t\t\tlet modNext = modifiedLineHeightOverrides.peek();\n\t\t\tif (origNext && origNext.lineNumber >= untilOriginalLineNumberExclusive) {\n\t\t\t\torigNext = undefined;\n\t\t\t}\n\t\t\tif (modNext && modNext.lineNumber >= untilModifiedLineNumberExclusive) {\n\t\t\t\tmodNext = undefined;\n\t\t\t}\n\t\t\tif (!origNext && !modNext) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst distOrig = origNext ? origNext.lineNumber - lastOriginalLineNumber : Number.MAX_VALUE;\n\t\t\tconst distNext = modNext ? modNext.lineNumber - lastModifiedLineNumber : Number.MAX_VALUE;\n\n\t\t\tif (distOrig < distNext) {\n\t\t\t\toriginalLineHeightOverrides.dequeue();\n\t\t\t\tmodNext = {\n\t\t\t\t\tlineNumber: origNext!.lineNumber - lastOriginalLineNumber + lastModifiedLineNumber,\n\t\t\t\t\theightInPx: 0,\n\t\t\t\t};\n\t\t\t} else if (distOrig > distNext) {\n\t\t\t\tmodifiedLineHeightOverrides.dequeue();\n\t\t\t\torigNext = {\n\t\t\t\t\tlineNumber: modNext!.lineNumber - lastModifiedLineNumber + lastOriginalLineNumber,\n\t\t\t\t\theightInPx: 0,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\toriginalLineHeightOverrides.dequeue();\n\t\t\t\tmodifiedLineHeightOverrides.dequeue();\n\t\t\t}\n\n\t\t\tresult.push({\n\t\t\t\toriginalRange: LineRange.ofLength(origNext!.lineNumber, 1),\n\t\t\t\tmodifiedRange: LineRange.ofLength(modNext!.lineNumber, 1),\n\t\t\t\toriginalHeightInPx: origLineHeight + origNext!.heightInPx,\n\t\t\t\tmodifiedHeightInPx: modLineHeight + modNext!.heightInPx,\n\t\t\t\tdiff: undefined,\n\t\t\t});\n\t\t}\n\t}\n\n\tfor (const m of diffs) {\n\t\tconst c = m.lineRangeMapping;\n\t\thandleAlignmentsOutsideOfDiffs(c.original.startLineNumber, c.modified.startLineNumber);\n\n\t\tlet first = true;\n\t\tlet lastModLineNumber = c.modified.startLineNumber;\n\t\tlet lastOrigLineNumber = c.original.startLineNumber;\n\n\t\tfunction emitAlignment(origLineNumberExclusive: number, modLineNumberExclusive: number, forceAlignment = false) {\n\t\t\tif (origLineNumberExclusive < lastOrigLineNumber || modLineNumberExclusive < lastModLineNumber) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (first) {\n\t\t\t\tfirst = false;\n\t\t\t} else if (!forceAlignment && (origLineNumberExclusive === lastOrigLineNumber || modLineNumberExclusive === lastModLineNumber)) {\n\t\t\t\t// This causes a re-alignment of an already aligned line.\n\t\t\t\t// However, we don't care for the final alignment.\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst originalRange = new LineRange(lastOrigLineNumber, origLineNumberExclusive);\n\t\t\tconst modifiedRange = new LineRange(lastModLineNumber, modLineNumberExclusive);\n\t\t\tif (originalRange.isEmpty && modifiedRange.isEmpty) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst originalAdditionalHeight = originalLineHeightOverrides\n\t\t\t\t.takeWhile(v => v.lineNumber < origLineNumberExclusive)\n\t\t\t\t?.reduce((p, c) => p + c.heightInPx, 0) ?? 0;\n\t\t\tconst modifiedAdditionalHeight = modifiedLineHeightOverrides\n\t\t\t\t.takeWhile(v => v.lineNumber < modLineNumberExclusive)\n\t\t\t\t?.reduce((p, c) => p + c.heightInPx, 0) ?? 0;\n\n\t\t\tresult.push({\n\t\t\t\toriginalRange,\n\t\t\t\tmodifiedRange,\n\t\t\t\toriginalHeightInPx: originalRange.length * origLineHeight + originalAdditionalHeight,\n\t\t\t\tmodifiedHeightInPx: modifiedRange.length * modLineHeight + modifiedAdditionalHeight,\n\t\t\t\tdiff: m.lineRangeMapping,\n\t\t\t});\n\n\t\t\tlastOrigLineNumber = origLineNumberExclusive;\n\t\t\tlastModLineNumber = modLineNumberExclusive;\n\t\t}\n\n\t\tif (innerHunkAlignment) {\n\t\t\tfor (const i of c.innerChanges || []) {\n\t\t\t\tif (i.originalRange.startColumn > 1 && i.modifiedRange.startColumn > 1) {\n\t\t\t\t\t// There is some unmodified text on this line before the diff\n\t\t\t\t\temitAlignment(i.originalRange.startLineNumber, i.modifiedRange.startLineNumber);\n\t\t\t\t}\n\t\t\t\tconst originalModel = originalEditor.getModel()!;\n\t\t\t\t// When the diff is invalid, the ranges might be out of bounds (this should be fixed in the diff model by applying edits directly).\n\t\t\t\tconst maxColumn = i.originalRange.endLineNumber <= originalModel.getLineCount() ? originalModel.getLineMaxColumn(i.originalRange.endLineNumber) : Number.MAX_SAFE_INTEGER;\n\t\t\t\tif (i.originalRange.endColumn < maxColumn) {\n\t\t\t\t\t// // There is some unmodified text on this line after the diff\n\t\t\t\t\temitAlignment(i.originalRange.endLineNumber, i.modifiedRange.endLineNumber);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\temitAlignment(c.original.endLineNumberExclusive, c.modified.endLineNumberExclusive, true);\n\n\t\tlastOriginalLineNumber = c.original.endLineNumberExclusive;\n\t\tlastModifiedLineNumber = c.modified.endLineNumberExclusive;\n\t}\n\thandleAlignmentsOutsideOfDiffs(Number.MAX_VALUE, Number.MAX_VALUE);\n\n\treturn result;\n}\n\ninterface AdditionalLineHeightInfo {\n\tlineNumber: number;\n\theightInPx: number;\n}\n\nfunction getAdditionalLineHeights(editor: CodeEditorWidget, viewZonesToIgnore: ReadonlySet<string>): readonly AdditionalLineHeightInfo[] {\n\tconst viewZoneHeights: { lineNumber: number; heightInPx: number }[] = [];\n\tconst wrappingZoneHeights: { lineNumber: number; heightInPx: number }[] = [];\n\n\tconst hasWrapping = editor.getOption(EditorOption.wrappingInfo).wrappingColumn !== -1;\n\tconst coordinatesConverter = editor._getViewModel()!.coordinatesConverter;\n\tconst editorLineHeight = editor.getOption(EditorOption.lineHeight);\n\tif (hasWrapping) {\n\t\tfor (let i = 1; i <= editor.getModel()!.getLineCount(); i++) {\n\t\t\tconst lineCount = coordinatesConverter.getModelLineViewLineCount(i);\n\t\t\tif (lineCount > 1) {\n\t\t\t\twrappingZoneHeights.push({ lineNumber: i, heightInPx: editorLineHeight * (lineCount - 1) });\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (const w of editor.getWhitespaces()) {\n\t\tif (viewZonesToIgnore.has(w.id)) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst modelLineNumber = w.afterLineNumber === 0 ? 0 : coordinatesConverter.convertViewPositionToModelPosition(\n\t\t\tnew Position(w.afterLineNumber, 1)\n\t\t).lineNumber;\n\t\tviewZoneHeights.push({ lineNumber: modelLineNumber, heightInPx: w.height });\n\t}\n\n\tconst result = joinCombine(\n\t\tviewZoneHeights,\n\t\twrappingZoneHeights,\n\t\tv => v.lineNumber,\n\t\t(v1, v2) => ({ lineNumber: v1.lineNumber, heightInPx: v1.heightInPx + v2.heightInPx })\n\t);\n\n\treturn result;\n}\n\nexport function allowsTrueInlineDiffRendering(mapping: DetailedLineRangeMapping): boolean {\n\tif (!mapping.innerChanges) {\n\t\treturn false;\n\t}\n\treturn mapping.innerChanges.every(c =>\n\t\t(rangeIsSingleLine(c.modifiedRange) && rangeIsSingleLine(c.originalRange))\n\t\t|| c.originalRange.equalsRange(new Range(1, 1, 1, 1))\n\t);\n}\n\nexport function rangeIsSingleLine(range: Range): boolean {\n\treturn range.startLineNumber === range.endLineNumber;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { $, addDisposableListener } from '../../../../../../base/browser/dom.js';\nimport { ArrayQueue } from '../../../../../../base/common/arrays.js';\nimport { RunOnceScheduler } from '../../../../../../base/common/async.js';\nimport { Codicon } from '../../../../../../base/common/codicons.js';\nimport { Disposable, DisposableStore } from '../../../../../../base/common/lifecycle.js';\nimport { IObservable, autorun, derived, observableFromEvent, observableValue } from '../../../../../../base/common/observable.js';\nimport { ThemeIcon } from '../../../../../../base/common/themables.js';\nimport { assertReturnsDefined } from '../../../../../../base/common/types.js';\nimport { applyFontInfo } from '../../../../config/domFontInfo.js';\nimport { CodeEditorWidget } from '../../../codeEditor/codeEditorWidget.js';\nimport { diffDeleteDecoration, diffRemoveIcon } from '../../registrations.contribution.js';\nimport { DiffEditorEditors } from '../diffEditorEditors.js';\nimport { DiffEditorViewModel, DiffMapping } from '../../diffEditorViewModel.js';\nimport { DiffEditorWidget } from '../../diffEditorWidget.js';\nimport { InlineDiffDeletedCodeMargin } from './inlineDiffDeletedCodeMargin.js';\nimport { LineSource, RenderOptions, renderLines } from './renderLines.js';\nimport { IObservableViewZone, animatedObservable, joinCombine } from '../../utils.js';\nimport { EditorOption } from '../../../../../common/config/editorOptions.js';\nimport { LineRange } from '../../../../../common/core/ranges/lineRange.js';\nimport { Position } from '../../../../../common/core/position.js';\nimport { DetailedLineRangeMapping } from '../../../../../common/diff/rangeMapping.js';\nimport { ScrollType } from '../../../../../common/editorCommon.js';\nimport { BackgroundTokenizationState } from '../../../../../common/tokenizationTextModelPart.js';\nimport { IClipboardService } from '../../../../../../platform/clipboard/common/clipboardService.js';\nimport { IContextMenuService } from '../../../../../../platform/contextview/browser/contextView.js';\nimport { DiffEditorOptions } from '../../diffEditorOptions.js';\nimport { Range } from '../../../../../common/core/range.js';\nimport { InlineDecoration, InlineDecorationType } from '../../../../../common/viewModel/inlineDecorations.js';\n\n/**\n * Ensures both editors have the same height by aligning unchanged lines.\n * In inline view mode, inserts viewzones to show deleted code from the original text model in the modified code editor.\n * Synchronizes scrolling.\n *\n * Make sure to add the view zones!\n */\nexport class DiffEditorViewZones extends Disposable {\n\tprivate readonly _originalTopPadding;\n\tprivate readonly _originalScrollTop: IObservable<number>;\n\tprivate readonly _originalScrollOffset;\n\tprivate readonly _originalScrollOffsetAnimated;\n\n\tprivate readonly _modifiedTopPadding;\n\tprivate readonly _modifiedScrollTop: IObservable<number>;\n\tprivate readonly _modifiedScrollOffset;\n\tprivate readonly _modifiedScrollOffsetAnimated;\n\n\tpublic readonly viewZones: IObservable<{ orig: IObservableViewZone[]; mod: IObservableViewZone[] }>;\n\n\tconstructor(\n\t\tprivate readonly _targetWindow: Window,\n\t\tprivate readonly _editors: DiffEditorEditors,\n\t\tprivate readonly _diffModel: IObservable<DiffEditorViewModel | undefined>,\n\t\tprivate readonly _options: DiffEditorOptions,\n\t\tprivate readonly _diffEditorWidget: DiffEditorWidget,\n\t\tprivate readonly _canIgnoreViewZoneUpdateEvent: () => boolean,\n\t\tprivate readonly _origViewZonesToIgnore: Set<string>,\n\t\tprivate readonly _modViewZonesToIgnore: Set<string>,\n\t\t@IClipboardService private readonly _clipboardService: IClipboardService,\n\t\t@IContextMenuService private readonly _contextMenuService: IContextMenuService,\n\t) {\n\t\tsuper();\n\t\tthis._originalTopPadding = observableValue(this, 0);\n\t\tthis._originalScrollOffset = observableValue<number, boolean>(this, 0);\n\t\tthis._originalScrollOffsetAnimated = animatedObservable(this._targetWindow, this._originalScrollOffset, this._store);\n\t\tthis._modifiedTopPadding = observableValue(this, 0);\n\t\tthis._modifiedScrollOffset = observableValue<number, boolean>(this, 0);\n\t\tthis._modifiedScrollOffsetAnimated = animatedObservable(this._targetWindow, this._modifiedScrollOffset, this._store);\n\n\t\tconst state = observableValue('invalidateAlignmentsState', 0);\n\n\t\tconst updateImmediately = this._register(new RunOnceScheduler(() => {\n\t\t\tstate.set(state.get() + 1, undefined);\n\t\t}, 0));\n\n\t\tthis._register(this._editors.original.onDidChangeViewZones((_args) => { if (!this._canIgnoreViewZoneUpdateEvent()) { updateImmediately.schedule(); } }));\n\t\tthis._register(this._editors.modified.onDidChangeViewZones((_args) => { if (!this._canIgnoreViewZoneUpdateEvent()) { updateImmediately.schedule(); } }));\n\t\tthis._register(this._editors.original.onDidChangeConfiguration((args) => {\n\t\t\tif (args.hasChanged(EditorOption.wrappingInfo) || args.hasChanged(EditorOption.lineHeight)) { updateImmediately.schedule(); }\n\t\t}));\n\t\tthis._register(this._editors.modified.onDidChangeConfiguration((args) => {\n\t\t\tif (args.hasChanged(EditorOption.wrappingInfo) || args.hasChanged(EditorOption.lineHeight)) { updateImmediately.schedule(); }\n\t\t}));\n\n\t\tconst originalModelTokenizationCompleted = this._diffModel.map(m =>\n\t\t\tm ? observableFromEvent(this, m.model.original.onDidChangeTokens, () => m.model.original.tokenization.backgroundTokenizationState === BackgroundTokenizationState.Completed) : undefined\n\t\t).map((m, reader) => m?.read(reader));\n\n\t\tconst alignments = derived<ILineRangeAlignment[] | null>((reader) => {\n\t\t\t/** @description alignments */\n\t\t\tconst diffModel = this._diffModel.read(reader);\n\t\t\tconst diff = diffModel?.diff.read(reader);\n\t\t\tif (!diffModel || !diff) { return null; }\n\t\t\tstate.read(reader);\n\t\t\tconst renderSideBySide = this._options.renderSideBySide.read(reader);\n\t\t\tconst innerHunkAlignment = renderSideBySide;\n\t\t\treturn computeRangeAlignment(\n\t\t\t\tthis._editors.original,\n\t\t\t\tthis._editors.modified,\n\t\t\t\tdiff.mappings,\n\t\t\t\tthis._origViewZonesToIgnore,\n\t\t\t\tthis._modViewZonesToIgnore,\n\t\t\t\tinnerHunkAlignment\n\t\t\t);\n\t\t});\n\n\t\tconst alignmentsSyncedMovedText = derived<ILineRangeAlignment[] | null>((reader) => {\n\t\t\t/** @description alignmentsSyncedMovedText */\n\t\t\tconst syncedMovedText = this._diffModel.read(reader)?.movedTextToCompare.read(reader);\n\t\t\tif (!syncedMovedText) { return null; }\n\t\t\tstate.read(reader);\n\t\t\tconst mappings = syncedMovedText.changes.map(c => new DiffMapping(c));\n\t\t\t// TODO dont include alignments outside syncedMovedText\n\t\t\treturn computeRangeAlignment(\n\t\t\t\tthis._editors.original,\n\t\t\t\tthis._editors.modified,\n\t\t\t\tmappings,\n\t\t\t\tthis._origViewZonesToIgnore,\n\t\t\t\tthis._modViewZonesToIgnore,\n\t\t\t\ttrue\n\t\t\t);\n\t\t});\n\n\t\tfunction createFakeLinesDiv(): HTMLElement {\n\t\t\tconst r = document.createElement('div');\n\t\t\tr.className = 'diagonal-fill';\n\t\t\treturn r;\n\t\t}\n\n\t\tconst alignmentViewZonesDisposables = this._register(new DisposableStore());\n\t\tthis.viewZones = derived<{ orig: IObservableViewZone[]; mod: IObservableViewZone[] }>(this, (reader) => {\n\t\t\talignmentViewZonesDisposables.clear();\n\n\t\t\tconst alignmentsVal = alignments.read(reader) || [];\n\n\t\t\tconst origViewZones: IObservableViewZone[] = [];\n\t\t\tconst modViewZones: IObservableViewZone[] = [];\n\n\t\t\tconst modifiedTopPaddingVal = this._modifiedTopPadding.read(reader);\n\t\t\tif (modifiedTopPaddingVal > 0) {\n\t\t\t\tmodViewZones.push({\n\t\t\t\t\tafterLineNumber: 0,\n\t\t\t\t\tdomNode: document.createElement('div'),\n\t\t\t\t\theightInPx: modifiedTopPaddingVal,\n\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst originalTopPaddingVal = this._originalTopPadding.read(reader);\n\t\t\tif (originalTopPaddingVal > 0) {\n\t\t\t\torigViewZones.push({\n\t\t\t\t\tafterLineNumber: 0,\n\t\t\t\t\tdomNode: document.createElement('div'),\n\t\t\t\t\theightInPx: originalTopPaddingVal,\n\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst renderSideBySide = this._options.renderSideBySide.read(reader);\n\n\t\t\tconst deletedCodeLineBreaksComputer = !renderSideBySide ? this._editors.modified._getViewModel()?.createLineBreaksComputer() : undefined;\n\t\t\tif (deletedCodeLineBreaksComputer) {\n\t\t\t\tconst originalModel = this._editors.original.getModel()!;\n\t\t\t\tfor (const a of alignmentsVal) {\n\t\t\t\t\tif (a.diff) {\n\t\t\t\t\t\tfor (let i = a.originalRange.startLineNumber; i < a.originalRange.endLineNumberExclusive; i++) {\n\t\t\t\t\t\t\t// `i` can be out of bound when the diff has not been updated yet.\n\t\t\t\t\t\t\t// In this case, we do an early return.\n\t\t\t\t\t\t\t// TODO@hediet: Fix this by applying the edit directly to the diff model, so that the diff is always valid.\n\t\t\t\t\t\t\tif (i > originalModel.getLineCount()) {\n\t\t\t\t\t\t\t\treturn { orig: origViewZones, mod: modViewZones };\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdeletedCodeLineBreaksComputer?.addRequest(originalModel.getLineContent(i), null, null);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst lineBreakData = deletedCodeLineBreaksComputer?.finalize() ?? [];\n\t\t\tlet lineBreakDataIdx = 0;\n\n\t\t\tconst modLineHeight = this._editors.modified.getOption(EditorOption.lineHeight);\n\n\t\t\tconst syncedMovedText = this._diffModel.read(reader)?.movedTextToCompare.read(reader);\n\n\t\t\tconst mightContainNonBasicASCII = this._editors.original.getModel()?.mightContainNonBasicASCII() ?? false;\n\t\t\tconst mightContainRTL = this._editors.original.getModel()?.mightContainRTL() ?? false;\n\t\t\tconst renderOptions = RenderOptions.fromEditor(this._editors.modified);\n\n\t\t\tfor (const a of alignmentsVal) {\n\t\t\t\tif (a.diff && !renderSideBySide && (!this._options.useTrueInlineDiffRendering.read(reader) || !allowsTrueInlineDiffRendering(a.diff))) {\n\t\t\t\t\tif (!a.originalRange.isEmpty) {\n\t\t\t\t\t\toriginalModelTokenizationCompleted.read(reader); // Update view-zones once tokenization completes\n\n\t\t\t\t\t\tconst deletedCodeDomNode = document.createElement('div');\n\t\t\t\t\t\tdeletedCodeDomNode.classList.add('view-lines', 'line-delete', 'monaco-mouse-cursor-text');\n\t\t\t\t\t\tconst originalModel = this._editors.original.getModel()!;\n\t\t\t\t\t\t// `a.originalRange` can be out of bound when the diff has not been updated yet.\n\t\t\t\t\t\t// In this case, we do an early return.\n\t\t\t\t\t\t// TODO@hediet: Fix this by applying the edit directly to the diff model, so that the diff is always valid.\n\t\t\t\t\t\tif (a.originalRange.endLineNumberExclusive - 1 > originalModel.getLineCount()) {\n\t\t\t\t\t\t\treturn { orig: origViewZones, mod: modViewZones };\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst source = new LineSource(\n\t\t\t\t\t\t\ta.originalRange.mapToLineArray(l => originalModel.tokenization.getLineTokens(l)),\n\t\t\t\t\t\t\ta.originalRange.mapToLineArray(_ => lineBreakData[lineBreakDataIdx++]),\n\t\t\t\t\t\t\tmightContainNonBasicASCII,\n\t\t\t\t\t\t\tmightContainRTL,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst decorations: InlineDecoration[] = [];\n\t\t\t\t\t\tfor (const i of a.diff.innerChanges || []) {\n\t\t\t\t\t\t\tdecorations.push(new InlineDecoration(\n\t\t\t\t\t\t\t\ti.originalRange.delta(-(a.diff.original.startLineNumber - 1)),\n\t\t\t\t\t\t\t\tdiffDeleteDecoration.className!,\n\t\t\t\t\t\t\t\tInlineDecorationType.Regular\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst result = renderLines(source, renderOptions, decorations, deletedCodeDomNode);\n\n\t\t\t\t\t\tconst marginDomNode = document.createElement('div');\n\t\t\t\t\t\tmarginDomNode.className = 'inline-deleted-margin-view-zone';\n\t\t\t\t\t\tapplyFontInfo(marginDomNode, renderOptions.fontInfo);\n\n\t\t\t\t\t\tif (this._options.renderIndicators.read(reader)) {\n\t\t\t\t\t\t\tfor (let i = 0; i < result.heightInLines; i++) {\n\t\t\t\t\t\t\t\tconst marginElement = document.createElement('div');\n\t\t\t\t\t\t\t\tmarginElement.className = `delete-sign ${ThemeIcon.asClassName(diffRemoveIcon)}`;\n\t\t\t\t\t\t\t\tmarginElement.setAttribute('style', `position:absolute;top:${i * modLineHeight}px;width:${renderOptions.lineDecorationsWidth}px;height:${modLineHeight}px;right:0;`);\n\t\t\t\t\t\t\t\tmarginDomNode.appendChild(marginElement);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet zoneId: string | undefined = undefined;\n\t\t\t\t\t\talignmentViewZonesDisposables.add(\n\t\t\t\t\t\t\tnew InlineDiffDeletedCodeMargin(\n\t\t\t\t\t\t\t\t() => assertReturnsDefined(zoneId),\n\t\t\t\t\t\t\t\tmarginDomNode,\n\t\t\t\t\t\t\t\tthis._editors.modified,\n\t\t\t\t\t\t\t\ta.diff,\n\t\t\t\t\t\t\t\tthis._diffEditorWidget,\n\t\t\t\t\t\t\t\tresult.viewLineCounts,\n\t\t\t\t\t\t\t\tthis._editors.original.getModel()!,\n\t\t\t\t\t\t\t\tthis._contextMenuService,\n\t\t\t\t\t\t\t\tthis._clipboardService,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tfor (let i = 0; i < result.viewLineCounts.length; i++) {\n\t\t\t\t\t\t\tconst count = result.viewLineCounts[i];\n\t\t\t\t\t\t\t// Account for wrapped lines in the (collapsed) original editor (which doesn't wrap lines).\n\t\t\t\t\t\t\tif (count > 1) {\n\t\t\t\t\t\t\t\torigViewZones.push({\n\t\t\t\t\t\t\t\t\tafterLineNumber: a.originalRange.startLineNumber + i,\n\t\t\t\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\t\t\t\theightInPx: (count - 1) * modLineHeight,\n\t\t\t\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmodViewZones.push({\n\t\t\t\t\t\t\tafterLineNumber: a.modifiedRange.startLineNumber - 1,\n\t\t\t\t\t\t\tdomNode: deletedCodeDomNode,\n\t\t\t\t\t\t\theightInPx: result.heightInLines * modLineHeight,\n\t\t\t\t\t\t\tminWidthInPx: result.minWidthInPx,\n\t\t\t\t\t\t\tmarginDomNode,\n\t\t\t\t\t\t\tsetZoneId(id) { zoneId = id; },\n\t\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tconst marginDomNode = document.createElement('div');\n\t\t\t\t\tmarginDomNode.className = 'gutter-delete';\n\n\t\t\t\t\torigViewZones.push({\n\t\t\t\t\t\tafterLineNumber: a.originalRange.endLineNumberExclusive - 1,\n\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\theightInPx: a.modifiedHeightInPx,\n\t\t\t\t\t\tmarginDomNode,\n\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tconst delta = a.modifiedHeightInPx - a.originalHeightInPx;\n\t\t\t\t\tif (delta > 0) {\n\t\t\t\t\t\tif (syncedMovedText?.lineRangeMapping.original.delta(-1).deltaLength(2).contains(a.originalRange.endLineNumberExclusive - 1)) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\torigViewZones.push({\n\t\t\t\t\t\t\tafterLineNumber: a.originalRange.endLineNumberExclusive - 1,\n\t\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\t\theightInPx: delta,\n\t\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (syncedMovedText?.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(a.modifiedRange.endLineNumberExclusive - 1)) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction createViewZoneMarginArrow(): HTMLElement {\n\t\t\t\t\t\t\tconst arrow = document.createElement('div');\n\t\t\t\t\t\t\tarrow.className = 'arrow-revert-change ' + ThemeIcon.asClassName(Codicon.arrowRight);\n\t\t\t\t\t\t\treader.store.add(addDisposableListener(arrow, 'mousedown', e => e.stopPropagation()));\n\t\t\t\t\t\t\treader.store.add(addDisposableListener(arrow, 'click', e => {\n\t\t\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\t\t\t_diffEditorWidget.revert(a.diff!);\n\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t\treturn $('div', {}, arrow);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet marginDomNode: HTMLElement | undefined = undefined;\n\t\t\t\t\t\tif (a.diff && a.diff.modified.isEmpty && this._options.shouldRenderOldRevertArrows.read(reader)) {\n\t\t\t\t\t\t\tmarginDomNode = createViewZoneMarginArrow();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmodViewZones.push({\n\t\t\t\t\t\t\tafterLineNumber: a.modifiedRange.endLineNumberExclusive - 1,\n\t\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\t\theightInPx: -delta,\n\t\t\t\t\t\t\tmarginDomNode,\n\t\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (const a of alignmentsSyncedMovedText.read(reader) ?? []) {\n\t\t\t\tif (!syncedMovedText?.lineRangeMapping.original.intersect(a.originalRange)\n\t\t\t\t\t|| !syncedMovedText?.lineRangeMapping.modified.intersect(a.modifiedRange)) {\n\t\t\t\t\t// ignore unrelated alignments outside the synced moved text\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst delta = a.modifiedHeightInPx - a.originalHeightInPx;\n\t\t\t\tif (delta > 0) {\n\t\t\t\t\torigViewZones.push({\n\t\t\t\t\t\tafterLineNumber: a.originalRange.endLineNumberExclusive - 1,\n\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\theightInPx: delta,\n\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tmodViewZones.push({\n\t\t\t\t\t\tafterLineNumber: a.modifiedRange.endLineNumberExclusive - 1,\n\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\theightInPx: -delta,\n\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn { orig: origViewZones, mod: modViewZones };\n\t\t});\n\n\t\tlet ignoreChange = false;\n\t\tthis._register(this._editors.original.onDidScrollChange(e => {\n\t\t\tif (e.scrollLeftChanged && !ignoreChange) {\n\t\t\t\tignoreChange = true;\n\t\t\t\tthis._editors.modified.setScrollLeft(e.scrollLeft);\n\t\t\t\tignoreChange = false;\n\t\t\t}\n\t\t}));\n\t\tthis._register(this._editors.modified.onDidScrollChange(e => {\n\t\t\tif (e.scrollLeftChanged && !ignoreChange) {\n\t\t\t\tignoreChange = true;\n\t\t\t\tthis._editors.original.setScrollLeft(e.scrollLeft);\n\t\t\t\tignoreChange = false;\n\t\t\t}\n\t\t}));\n\n\t\tthis._originalScrollTop = observableFromEvent(this._editors.original.onDidScrollChange, () => /** @description original.getScrollTop */ this._editors.original.getScrollTop());\n\t\tthis._modifiedScrollTop = observableFromEvent(this._editors.modified.onDidScrollChange, () => /** @description modified.getScrollTop */ this._editors.modified.getScrollTop());\n\n\t\t// origExtraHeight + origOffset - origScrollTop = modExtraHeight + modOffset - modScrollTop\n\n\t\t// origScrollTop = origExtraHeight + origOffset - modExtraHeight - modOffset + modScrollTop\n\t\t// modScrollTop = modExtraHeight + modOffset - origExtraHeight - origOffset + origScrollTop\n\n\t\t// origOffset - modOffset = heightOfLines(1..Y) - heightOfLines(1..X)\n\t\t// origScrollTop >= 0, modScrollTop >= 0\n\n\t\tthis._register(autorun(reader => {\n\t\t\t/** @description update scroll modified */\n\t\t\tconst newScrollTopModified = this._originalScrollTop.read(reader)\n\t\t\t\t- (this._originalScrollOffsetAnimated.read(undefined) - this._modifiedScrollOffsetAnimated.read(reader))\n\t\t\t\t- (this._originalTopPadding.read(undefined) - this._modifiedTopPadding.read(reader));\n\t\t\tif (newScrollTopModified !== this._editors.modified.getScrollTop()) {\n\t\t\t\tthis._editors.modified.setScrollTop(newScrollTopModified, ScrollType.Immediate);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\t/** @description update scroll original */\n\t\t\tconst newScrollTopOriginal = this._modifiedScrollTop.read(reader)\n\t\t\t\t- (this._modifiedScrollOffsetAnimated.read(undefined) - this._originalScrollOffsetAnimated.read(reader))\n\t\t\t\t- (this._modifiedTopPadding.read(undefined) - this._originalTopPadding.read(reader));\n\t\t\tif (newScrollTopOriginal !== this._editors.original.getScrollTop()) {\n\t\t\t\tthis._editors.original.setScrollTop(newScrollTopOriginal, ScrollType.Immediate);\n\t\t\t}\n\t\t}));\n\n\n\t\tthis._register(autorun(reader => {\n\t\t\t/** @description update editor top offsets */\n\t\t\tconst m = this._diffModel.read(reader)?.movedTextToCompare.read(reader);\n\n\t\t\tlet deltaOrigToMod = 0;\n\t\t\tif (m) {\n\t\t\t\tconst trueTopOriginal = this._editors.original.getTopForLineNumber(m.lineRangeMapping.original.startLineNumber, true) - this._originalTopPadding.read(undefined);\n\t\t\t\tconst trueTopModified = this._editors.modified.getTopForLineNumber(m.lineRangeMapping.modified.startLineNumber, true) - this._modifiedTopPadding.read(undefined);\n\t\t\t\tdeltaOrigToMod = trueTopModified - trueTopOriginal;\n\t\t\t}\n\n\t\t\tif (deltaOrigToMod > 0) {\n\t\t\t\tthis._modifiedTopPadding.set(0, undefined);\n\t\t\t\tthis._originalTopPadding.set(deltaOrigToMod, undefined);\n\t\t\t} else if (deltaOrigToMod < 0) {\n\t\t\t\tthis._modifiedTopPadding.set(-deltaOrigToMod, undefined);\n\t\t\t\tthis._originalTopPadding.set(0, undefined);\n\t\t\t} else {\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tthis._modifiedTopPadding.set(0, undefined);\n\t\t\t\t\tthis._originalTopPadding.set(0, undefined);\n\t\t\t\t}, 400);\n\t\t\t}\n\n\t\t\tif (this._editors.modified.hasTextFocus()) {\n\t\t\t\tthis._originalScrollOffset.set(this._modifiedScrollOffset.read(undefined) - deltaOrigToMod, undefined, true);\n\t\t\t} else {\n\t\t\t\tthis._modifiedScrollOffset.set(this._originalScrollOffset.read(undefined) + deltaOrigToMod, undefined, true);\n\t\t\t}\n\t\t}));\n\t}\n}\n\ninterface ILineRangeAlignment {\n\toriginalRange: LineRange;\n\tmodifiedRange: LineRange;\n\n\t// accounts for foreign viewzones and line wrapping\n\toriginalHeightInPx: number;\n\tmodifiedHeightInPx: number;\n\n\t/**\n\t * If this range alignment is a direct result of a diff, then this is the diff's line mapping.\n\t * Only used for inline-view.\n\t */\n\tdiff?: DetailedLineRangeMapping;\n}\n\nfunction computeRangeAlignment(\n\toriginalEditor: CodeEditorWidget,\n\tmodifiedEditor: CodeEditorWidget,\n\tdiffs: readonly DiffMapping[],\n\toriginalEditorAlignmentViewZones: ReadonlySet<string>,\n\tmodifiedEditorAlignmentViewZones: ReadonlySet<string>,\n\tinnerHunkAlignment: boolean,\n): ILineRangeAlignment[] {\n\tconst originalLineHeightOverrides = new ArrayQueue(getAdditionalLineHeights(originalEditor, originalEditorAlignmentViewZones));\n\tconst modifiedLineHeightOverrides = new ArrayQueue(getAdditionalLineHeights(modifiedEditor, modifiedEditorAlignmentViewZones));\n\n\tconst origLineHeight = originalEditor.getOption(EditorOption.lineHeight);\n\tconst modLineHeight = modifiedEditor.getOption(EditorOption.lineHeight);\n\n\tconst result: ILineRangeAlignment[] = [];\n\n\tlet lastOriginalLineNumber = 0;\n\tlet lastModifiedLineNumber = 0;\n\n\tfunction handleAlignmentsOutsideOfDiffs(untilOriginalLineNumberExclusive: number, untilModifiedLineNumberExclusive: number) {\n\t\twhile (true) {\n\t\t\tlet origNext = originalLineHeightOverrides.peek();\n\t\t\tlet modNext = modifiedLineHeightOverrides.peek();\n\t\t\tif (origNext && origNext.lineNumber >= untilOriginalLineNumberExclusive) {\n\t\t\t\torigNext = undefined;\n\t\t\t}\n\t\t\tif (modNext && modNext.lineNumber >= untilModifiedLineNumberExclusive) {\n\t\t\t\tmodNext = undefined;\n\t\t\t}\n\t\t\tif (!origNext && !modNext) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst distOrig = origNext ? origNext.lineNumber - lastOriginalLineNumber : Number.MAX_VALUE;\n\t\t\tconst distNext = modNext ? modNext.lineNumber - lastModifiedLineNumber : Number.MAX_VALUE;\n\n\t\t\tif (distOrig < distNext) {\n\t\t\t\toriginalLineHeightOverrides.dequeue();\n\t\t\t\tmodNext = {\n\t\t\t\t\tlineNumber: origNext!.lineNumber - lastOriginalLineNumber + lastModifiedLineNumber,\n\t\t\t\t\theightInPx: 0,\n\t\t\t\t};\n\t\t\t} else if (distOrig > distNext) {\n\t\t\t\tmodifiedLineHeightOverrides.dequeue();\n\t\t\t\torigNext = {\n\t\t\t\t\tlineNumber: modNext!.lineNumber - lastModifiedLineNumber + lastOriginalLineNumber,\n\t\t\t\t\theightInPx: 0,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\toriginalLineHeightOverrides.dequeue();\n\t\t\t\tmodifiedLineHeightOverrides.dequeue();\n\t\t\t}\n\n\t\t\tresult.push({\n\t\t\t\toriginalRange: LineRange.ofLength(origNext!.lineNumber, 1),\n\t\t\t\tmodifiedRange: LineRange.ofLength(modNext!.lineNumber, 1),\n\t\t\t\toriginalHeightInPx: origLineHeight + origNext!.heightInPx,\n\t\t\t\tmodifiedHeightInPx: modLineHeight + modNext!.heightInPx,\n\t\t\t\tdiff: undefined,\n\t\t\t});\n\t\t}\n\t}\n\n\tfor (const m of diffs) {\n\t\tconst c = m.lineRangeMapping;\n\t\thandleAlignmentsOutsideOfDiffs(c.original.startLineNumber, c.modified.startLineNumber);\n\n\t\tlet first = true;\n\t\tlet lastModLineNumber = c.modified.startLineNumber;\n\t\tlet lastOrigLineNumber = c.original.startLineNumber;\n\n\t\tfunction emitAlignment(origLineNumberExclusive: number, modLineNumberExclusive: number, forceAlignment = false) {\n\t\t\tif (origLineNumberExclusive < lastOrigLineNumber || modLineNumberExclusive < lastModLineNumber) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (first) {\n\t\t\t\tfirst = false;\n\t\t\t} else if (!forceAlignment && (origLineNumberExclusive === lastOrigLineNumber || modLineNumberExclusive === lastModLineNumber)) {\n\t\t\t\t// This causes a re-alignment of an already aligned line.\n\t\t\t\t// However, we don't care for the final alignment.\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst originalRange = new LineRange(lastOrigLineNumber, origLineNumberExclusive);\n\t\t\tconst modifiedRange = new LineRange(lastModLineNumber, modLineNumberExclusive);\n\t\t\tif (originalRange.isEmpty && modifiedRange.isEmpty) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst originalAdditionalHeight = originalLineHeightOverrides\n\t\t\t\t.takeWhile(v => v.lineNumber < origLineNumberExclusive)\n\t\t\t\t?.reduce((p, c) => p + c.heightInPx, 0) ?? 0;\n\t\t\tconst modifiedAdditionalHeight = modifiedLineHeightOverrides\n\t\t\t\t.takeWhile(v => v.lineNumber < modLineNumberExclusive)\n\t\t\t\t?.reduce((p, c) => p + c.heightInPx, 0) ?? 0;\n\n\t\t\tresult.push({\n\t\t\t\toriginalRange,\n\t\t\t\tmodifiedRange,\n\t\t\t\toriginalHeightInPx: originalRange.length * origLineHeight + originalAdditionalHeight,\n\t\t\t\tmodifiedHeightInPx: modifiedRange.length * modLineHeight + modifiedAdditionalHeight,\n\t\t\t\tdiff: m.lineRangeMapping,\n\t\t\t});\n\n\t\t\tlastOrigLineNumber = origLineNumberExclusive;\n\t\t\tlastModLineNumber = modLineNumberExclusive;\n\t\t}\n\n\t\tif (innerHunkAlignment) {\n\t\t\tfor (const i of c.innerChanges || []) {\n\t\t\t\tif (i.originalRange.startColumn > 1 && i.modifiedRange.startColumn > 1) {\n\t\t\t\t\t// There is some unmodified text on this line before the diff\n\t\t\t\t\temitAlignment(i.originalRange.startLineNumber, i.modifiedRange.startLineNumber);\n\t\t\t\t}\n\t\t\t\tconst originalModel = originalEditor.getModel()!;\n\t\t\t\t// When the diff is invalid, the ranges might be out of bounds (this should be fixed in the diff model by applying edits directly).\n\t\t\t\tconst maxColumn = i.originalRange.endLineNumber <= originalModel.getLineCount() ? originalModel.getLineMaxColumn(i.originalRange.endLineNumber) : Number.MAX_SAFE_INTEGER;\n\t\t\t\tif (i.originalRange.endColumn < maxColumn) {\n\t\t\t\t\t// // There is some unmodified text on this line after the diff\n\t\t\t\t\temitAlignment(i.originalRange.endLineNumber, i.modifiedRange.endLineNumber);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\temitAlignment(c.original.endLineNumberExclusive, c.modified.endLineNumberExclusive, true);\n\n\t\tlastOriginalLineNumber = c.original.endLineNumberExclusive;\n\t\tlastModifiedLineNumber = c.modified.endLineNumberExclusive;\n\t}\n\thandleAlignmentsOutsideOfDiffs(Number.MAX_VALUE, Number.MAX_VALUE);\n\n\treturn result;\n}\n\ninterface AdditionalLineHeightInfo {\n\tlineNumber: number;\n\theightInPx: number;\n}\n\nfunction getAdditionalLineHeights(editor: CodeEditorWidget, viewZonesToIgnore: ReadonlySet<string>): readonly AdditionalLineHeightInfo[] {\n\tconst viewZoneHeights: { lineNumber: number; heightInPx: number }[] = [];\n\tconst wrappingZoneHeights: { lineNumber: number; heightInPx: number }[] = [];\n\n\tconst hasWrapping = editor.getOption(EditorOption.wrappingInfo).wrappingColumn !== -1;\n\tconst coordinatesConverter = editor._getViewModel()!.coordinatesConverter;\n\tconst editorLineHeight = editor.getOption(EditorOption.lineHeight);\n\tif (hasWrapping) {\n\t\tfor (let i = 1; i <= editor.getModel()!.getLineCount(); i++) {\n\t\t\tconst lineCount = coordinatesConverter.getModelLineViewLineCount(i);\n\t\t\tif (lineCount > 1) {\n\t\t\t\twrappingZoneHeights.push({ lineNumber: i, heightInPx: editorLineHeight * (lineCount - 1) });\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (const w of editor.getWhitespaces()) {\n\t\tif (viewZonesToIgnore.has(w.id)) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst modelLineNumber = w.afterLineNumber === 0 ? 0 : coordinatesConverter.convertViewPositionToModelPosition(\n\t\t\tnew Position(w.afterLineNumber, 1)\n\t\t).lineNumber;\n\t\tviewZoneHeights.push({ lineNumber: modelLineNumber, heightInPx: w.height });\n\t}\n\n\tconst result = joinCombine(\n\t\tviewZoneHeights,\n\t\twrappingZoneHeights,\n\t\tv => v.lineNumber,\n\t\t(v1, v2) => ({ lineNumber: v1.lineNumber, heightInPx: v1.heightInPx + v2.heightInPx })\n\t);\n\n\treturn result;\n}\n\nexport function allowsTrueInlineDiffRendering(mapping: DetailedLineRangeMapping): boolean {\n\tif (!mapping.innerChanges) {\n\t\treturn false;\n\t}\n\treturn mapping.innerChanges.every(c =>\n\t\t(rangeIsSingleLine(c.modifiedRange) && rangeIsSingleLine(c.originalRange))\n\t\t|| c.originalRange.equalsRange(new Range(1, 1, 1, 1))\n\t);\n}\n\nexport function rangeIsSingleLine(range: Range): boolean {\n\treturn range.startLineNumber === range.endLineNumber;\n}\n"]}
@@ -48,7 +48,7 @@ let DiffEditorViewModel = class DiffEditorViewModel extends Disposable {
48
48
  else {
49
49
  // Reset state
50
50
  transaction(tx => {
51
- for (const r of this._unchangedRegions.get()?.regions || []) {
51
+ for (const r of this._unchangedRegions.read(undefined)?.regions || []) {
52
52
  r.collapseAll(tx);
53
53
  }
54
54
  });
@@ -93,7 +93,7 @@ let DiffEditorViewModel = class DiffEditorViewModel extends Disposable {
93
93
  if (touching.length > 1) {
94
94
  didChange = true;
95
95
  const sumLineCount = touching.reduce((sum, r) => sum + r.lineCount, 0);
96
- const r = new UnchangedRegion(touching[0].originalLineNumber, touching[0].modifiedLineNumber, sumLineCount, touching[0].visibleLineCountTop.get(), touching[touching.length - 1].visibleLineCountBottom.get());
96
+ const r = new UnchangedRegion(touching[0].originalLineNumber, touching[0].modifiedLineNumber, sumLineCount, touching[0].visibleLineCountTop.read(undefined), touching[touching.length - 1].visibleLineCountBottom.read(undefined));
97
97
  newRanges.push(r);
98
98
  }
99
99
  else {
@@ -236,7 +236,7 @@ let DiffEditorViewModel = class DiffEditorViewModel extends Disposable {
236
236
  const state = DiffState.fromDiffResult(result);
237
237
  this._diff.set(state, tx);
238
238
  this._isDiffUpToDate.set(true, tx);
239
- const currentSyncedMovedText = this.movedTextToCompare.get();
239
+ const currentSyncedMovedText = this.movedTextToCompare.read(undefined);
240
240
  this.movedTextToCompare.set(currentSyncedMovedText ? this._lastDiff.moves.find(m => m.lineRangeMapping.modified.intersect(currentSyncedMovedText.lineRangeMapping.modified)) : undefined, tx);
241
241
  });
242
242
  }));