monaco-editor-core 0.55.0-dev-20251106 → 0.55.0-rc
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.
- package/esm/nls.keys.json +1 -1
- package/esm/nls.messages.cs.js +2 -2
- package/esm/nls.messages.de.js +2 -2
- package/esm/nls.messages.es.js +2 -2
- package/esm/nls.messages.fr.js +2 -2
- package/esm/nls.messages.it.js +2 -2
- package/esm/nls.messages.ja.js +2 -2
- package/esm/nls.messages.js +1 -1
- package/esm/nls.messages.json +1 -1
- package/esm/nls.messages.ko.js +2 -2
- package/esm/nls.messages.pl.js +2 -2
- package/esm/nls.messages.pt-br.js +2 -2
- package/esm/nls.messages.ru.js +2 -2
- package/esm/nls.messages.tr.js +2 -2
- package/esm/nls.messages.zh-cn.js +2 -2
- package/esm/nls.messages.zh-tw.js +2 -2
- package/esm/nls.metadata.json +0 -6
- package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/copySelection.js +24 -83
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/copySelection.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.js +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js +13 -17
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/renderLines.js +81 -9
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/renderLines.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/diffEditor.contribution.js +5 -5
- package/esm/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js +7 -7
- package/esm/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js +2 -2
- package/esm/vs/editor/browser/widget/diffEditor/features/revertButtonsFeature.js +2 -2
- package/esm/vs/editor/browser/widget/diffEditor/registrations.contribution.js +5 -5
- package/esm/vs/editor/browser/widget/multiDiffEditor/colors.js +3 -3
- package/esm/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.js +1 -1
- package/esm/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.js.map +1 -1
- package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js +2 -2
- package/esm/vs/editor/common/config/editorConfigurationSchema.js +54 -54
- package/esm/vs/editor/common/config/editorOptions.js +407 -407
- package/esm/vs/editor/common/config/editorOptions.js.map +1 -1
- package/esm/vs/editor/common/core/editorColorRegistry.js +68 -68
- package/esm/vs/editor/common/editorContextKeys.js +47 -47
- package/esm/vs/editor/common/languages/modesRegistry.js +1 -1
- package/esm/vs/editor/common/languages.js +56 -56
- package/esm/vs/editor/common/model/editStack.js +1 -1
- package/esm/vs/editor/common/standaloneStrings.js +10 -10
- package/esm/vs/editor/common/textModelEditSource.js +2 -2
- package/esm/vs/editor/common/textModelEditSource.js.map +1 -1
- package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +2 -2
- package/esm/vs/editor/contrib/anchorSelect/browser/anchorSelect.js +6 -6
- package/esm/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +6 -6
- package/esm/vs/editor/contrib/caretOperations/browser/caretOperations.js +2 -2
- package/esm/vs/editor/contrib/caretOperations/browser/transpose.js +1 -1
- package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +17 -17
- package/esm/vs/editor/contrib/codeAction/browser/codeAction.js +1 -1
- package/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js +29 -29
- package/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js +3 -3
- package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js +3 -3
- package/esm/vs/editor/contrib/codeAction/browser/codeActionMenu.js +8 -8
- package/esm/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +9 -9
- package/esm/vs/editor/contrib/codelens/browser/codelensController.js +2 -2
- package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerCloseButton.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerHeader.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +7 -7
- package/esm/vs/editor/contrib/comment/browser/comment.js +6 -6
- package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js +10 -10
- package/esm/vs/editor/contrib/cursorUndo/browser/cursorUndo.js +2 -2
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +4 -4
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +9 -9
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +8 -8
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +3 -3
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +2 -2
- package/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js +1 -1
- package/esm/vs/editor/contrib/find/browser/findController.js +16 -16
- package/esm/vs/editor/contrib/find/browser/findWidget.js +26 -26
- package/esm/vs/editor/contrib/folding/browser/folding.js +20 -20
- package/esm/vs/editor/contrib/folding/browser/folding.js.map +1 -1
- package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js +9 -9
- package/esm/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
- package/esm/vs/editor/contrib/format/browser/format.js +3 -7
- package/esm/vs/editor/contrib/format/browser/format.js.map +1 -1
- package/esm/vs/editor/contrib/format/browser/formatActions.js +2 -2
- package/esm/vs/editor/contrib/gotoError/browser/gotoError.js +8 -8
- package/esm/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +14 -14
- package/esm/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +39 -39
- package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +1 -1
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +8 -8
- package/esm/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +3 -3
- package/esm/vs/editor/contrib/gpu/browser/gpuActions.js +4 -4
- package/esm/vs/editor/contrib/hover/browser/hoverActionIds.js +2 -2
- package/esm/vs/editor/contrib/hover/browser/hoverActions.js +24 -24
- package/esm/vs/editor/contrib/hover/browser/hoverCopyButton.js +2 -2
- package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +9 -9
- package/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js +5 -5
- package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
- package/esm/vs/editor/contrib/indentation/browser/indentation.js +20 -20
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +8 -8
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +20 -20
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +12 -12
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +5 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +6 -6
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +20 -20
- package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
- package/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
- package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +31 -31
- package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
- package/esm/vs/editor/contrib/links/browser/links.js +10 -10
- package/esm/vs/editor/contrib/message/browser/messageController.js +1 -1
- package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
- package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
- package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +10 -10
- package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
- package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
- package/esm/vs/editor/contrib/rename/browser/rename.js +11 -11
- package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
- package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
- package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +4 -4
- package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
- package/esm/vs/editor/contrib/suggest/browser/suggest.js +8 -8
- package/esm/vs/editor/contrib/suggest/browser/suggestController.js +10 -10
- package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +17 -17
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +2 -2
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
- package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +1 -1
- package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
- package/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
- package/esm/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +24 -24
- package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
- package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
- package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -3
- package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +1 -1
- package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +62 -62
- package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
- package/esm/vs/platform/actionWidget/browser/actionList.js +4 -4
- package/esm/vs/platform/actionWidget/browser/actionWidget.js +7 -7
- package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +5 -5
- package/esm/vs/platform/actions/browser/toolbar.js +2 -2
- package/esm/vs/platform/actions/common/menuService.js +2 -2
- package/esm/vs/platform/configuration/common/configurationRegistry.js +10 -10
- package/esm/vs/platform/contextkey/browser/contextKeyService.js +1 -1
- package/esm/vs/platform/contextkey/common/contextkey.js +9 -9
- package/esm/vs/platform/contextkey/common/contextkeys.js +9 -9
- package/esm/vs/platform/contextkey/common/scanner.js +5 -5
- package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
- package/esm/vs/platform/hover/browser/hoverWidget.js +1 -1
- package/esm/vs/platform/hover/browser/updatableHoverWidget.js +1 -1
- package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +4 -4
- package/esm/vs/platform/list/browser/listService.js +29 -29
- package/esm/vs/platform/list/browser/listService.js.map +1 -1
- package/esm/vs/platform/markers/common/markerService.js +2 -2
- package/esm/vs/platform/markers/common/markers.js +6 -6
- package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +7 -7
- package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
- package/esm/vs/platform/quickinput/browser/quickInput.js +10 -10
- package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
- package/esm/vs/platform/quickinput/browser/quickInputController.js +6 -6
- package/esm/vs/platform/quickinput/browser/quickInputList.js +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
- package/esm/vs/platform/theme/common/colorUtils.js +2 -2
- package/esm/vs/platform/theme/common/colors/baseColors.js +17 -17
- package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -8
- package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
- package/esm/vs/platform/theme/common/colors/inputColors.js +47 -47
- package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
- package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
- package/esm/vs/platform/theme/common/colors/minimapColors.js +11 -11
- package/esm/vs/platform/theme/common/colors/miscColors.js +16 -16
- package/esm/vs/platform/theme/common/colors/quickpickColors.js +9 -9
- package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
- package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
- package/esm/vs/platform/undoRedo/common/undoRedoService.js +20 -20
- package/esm/vs/platform/workspace/common/workspace.js +1 -1
- package/package.json +2 -2
- package/version.txt +1 -1
package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/copySelection.js
CHANGED
|
@@ -2,103 +2,44 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { addDisposableListener
|
|
6
|
-
import { Action } from '../../../../../../base/common/actions.js';
|
|
5
|
+
import { addDisposableListener } from '../../../../../../base/browser/dom.js';
|
|
7
6
|
import { DisposableStore } from '../../../../../../base/common/lifecycle.js';
|
|
8
|
-
import { Position } from '../../../../../common/core/position.js';
|
|
9
7
|
import { Range } from '../../../../../common/core/range.js';
|
|
10
|
-
import { localize } from '../../../../../../nls.js';
|
|
11
8
|
export function enableCopySelection(options) {
|
|
12
|
-
const { domNode,
|
|
13
|
-
let lastMouseDownPosition;
|
|
9
|
+
const { domNode, renderLinesResult, diffEntry, originalModel, clipboardService } = options;
|
|
14
10
|
const viewZoneDisposable = new DisposableStore();
|
|
15
|
-
viewZoneDisposable.add(
|
|
16
|
-
|
|
11
|
+
viewZoneDisposable.add(addDisposableListener(domNode, 'copy', (e) => {
|
|
12
|
+
e.preventDefault();
|
|
13
|
+
const selection = domNode.ownerDocument.getSelection();
|
|
14
|
+
if (!selection || selection.rangeCount === 0) {
|
|
17
15
|
return;
|
|
18
16
|
}
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
const domRange = selection.getRangeAt(0);
|
|
18
|
+
if (!domRange || domRange.collapsed) {
|
|
21
19
|
return;
|
|
22
20
|
}
|
|
23
|
-
|
|
21
|
+
const startElement = domRange.startContainer.nodeType === Node.TEXT_NODE
|
|
22
|
+
? domRange.startContainer.parentElement
|
|
23
|
+
: domRange.startContainer;
|
|
24
|
+
const endElement = domRange.endContainer.nodeType === Node.TEXT_NODE
|
|
25
|
+
? domRange.endContainer.parentElement
|
|
26
|
+
: domRange.endContainer;
|
|
27
|
+
if (!startElement || !endElement) {
|
|
24
28
|
return;
|
|
25
29
|
}
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
}));
|
|
30
|
-
viewZoneDisposable.add(editor.onMouseUp(e => {
|
|
31
|
-
if (!lastMouseDownPosition) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
const mouseDownPosition = lastMouseDownPosition;
|
|
35
|
-
lastMouseDownPosition = undefined;
|
|
36
|
-
if (!e.event.leftButton) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
if ((e.target.type !== 8 /* MouseTargetType.CONTENT_VIEW_ZONE */ &&
|
|
40
|
-
e.target.type !== 5 /* MouseTargetType.GUTTER_VIEW_ZONE */) ||
|
|
41
|
-
e.target.detail.viewZoneId !== getViewZoneId()) {
|
|
30
|
+
const startPosition = renderLinesResult.getModelPositionAt(startElement, domRange.startOffset);
|
|
31
|
+
const endPosition = renderLinesResult.getModelPositionAt(endElement, domRange.endOffset);
|
|
32
|
+
if (!startPosition || !endPosition) {
|
|
42
33
|
return;
|
|
43
34
|
}
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
Range.fromPositions(
|
|
49
|
-
Range.fromPositions(mouseDownPosition, mouseUpPosition);
|
|
35
|
+
const adjustedStart = startPosition.delta(diffEntry.original.startLineNumber - 1);
|
|
36
|
+
const adjustedEnd = endPosition.delta(diffEntry.original.startLineNumber - 1);
|
|
37
|
+
const range = adjustedEnd.isBefore(adjustedStart) ?
|
|
38
|
+
Range.fromPositions(adjustedEnd, adjustedStart) :
|
|
39
|
+
Range.fromPositions(adjustedStart, adjustedEnd);
|
|
50
40
|
const selectedText = originalModel.getValueInRange(range);
|
|
51
|
-
|
|
52
|
-
e.preventDefault();
|
|
53
|
-
clipboardService.writeText(selectedText);
|
|
54
|
-
}));
|
|
55
|
-
showContextMenu({ x: e.event.posx, y: e.event.posy + editorLineHeight }, selectedText ?
|
|
56
|
-
[new Action('diff.clipboard.copySelectedDeletedContent', localize(112, 'Copy Selection'), undefined, true, async () => clipboardService.writeText(selectedText))] :
|
|
57
|
-
[], () => {
|
|
58
|
-
onCopy.dispose();
|
|
59
|
-
});
|
|
41
|
+
clipboardService.writeText(selectedText);
|
|
60
42
|
}));
|
|
61
43
|
return viewZoneDisposable;
|
|
62
44
|
}
|
|
63
|
-
/**
|
|
64
|
-
* Calculate the line number offset of the given browser event y-coordinate in a
|
|
65
|
-
* view zone.
|
|
66
|
-
*
|
|
67
|
-
* @param y The y-coordinate position of the browser event.
|
|
68
|
-
* @param viewZoneNode The view zone HTML element.
|
|
69
|
-
* @param editorLineHeight The line height of the editor.
|
|
70
|
-
* @param viewLineCounts The actual view lines for each editor line (considers
|
|
71
|
-
* line-wrapping).
|
|
72
|
-
* @return The line number offset in the given view zone.
|
|
73
|
-
*/
|
|
74
|
-
function calculateLineNumberOffset(y, viewZoneNode, editorLineHeight, viewLineCounts) {
|
|
75
|
-
const { top } = getDomNodePagePosition(viewZoneNode);
|
|
76
|
-
const offset = y - top;
|
|
77
|
-
const lineNumberOffset = Math.floor(offset / editorLineHeight);
|
|
78
|
-
let acc = 0;
|
|
79
|
-
for (let i = 0; i < viewLineCounts.length; i++) {
|
|
80
|
-
acc += viewLineCounts[i];
|
|
81
|
-
if (lineNumberOffset < acc) {
|
|
82
|
-
return i;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
return lineNumberOffset;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Get the real column number of the given mouse column in a view zone. This
|
|
89
|
-
* compensates for different tab sizes.
|
|
90
|
-
*
|
|
91
|
-
* @param mouseColumn The mouse column position of the browser event.
|
|
92
|
-
* @param lineNumber The line number of the original text model.
|
|
93
|
-
* @param textModel The original text model.
|
|
94
|
-
* @return The real column number of the given mouse column in the view zone.
|
|
95
|
-
*/
|
|
96
|
-
function getRealColumnNumber(mouseColumn, lineNumber, textModel) {
|
|
97
|
-
const lineContent = textModel.getLineContent(lineNumber);
|
|
98
|
-
let i = 0;
|
|
99
|
-
while (i < lineContent.length && lineContent[i] === '\t') {
|
|
100
|
-
i++;
|
|
101
|
-
}
|
|
102
|
-
return Math.max(1, mouseColumn - i * (textModel.getOptions().tabSize - 1));
|
|
103
|
-
}
|
|
104
45
|
//# sourceMappingURL=copySelection.js.map
|
package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/copySelection.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
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,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAChD,GAAG,IAAI,cAAc,CAAC,CAAC,CAAC,CAAC;QACzB,IAAI,gBAAgB,GAAG,GAAG,EAAE,CAAC;YAC5B,OAAO,CAAC,CAAC;QACV,CAAC;IACF,CAAC;IACD,OAAO,gBAAgB,CAAC;AACzB,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,mBAAmB,CAC3B,WAAmB,EACnB,UAAkB,EAClB,SAAqB;IAErB,MAAM,WAAW,GAAG,SAAS,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;IACzD,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,OAAO,CAAC,GAAG,WAAW,CAAC,MAAM,IAAI,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QAAC,CAAC,EAAE,CAAC;IAAC,CAAC;IAClE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC;AAC5E,CAAC","file":"copySelection.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, getDomNodePagePosition } from '../../../../../../base/browser/dom.js';\nimport { Action } from '../../../../../../base/common/actions.js';\nimport { DisposableStore } from '../../../../../../base/common/lifecycle.js';\nimport { ICodeEditor, MouseTargetType } from '../../../../../browser/editorBrowser.js';\nimport { Position } from '../../../../../common/core/position.js';\nimport { Range } from '../../../../../common/core/range.js';\nimport { DetailedLineRangeMapping } from '../../../../../common/diff/rangeMapping.js';\nimport { ITextModel } from '../../../../../common/model.js';\nimport { localize } from '../../../../../../nls.js';\nimport { IClipboardService } from '../../../../../../platform/clipboard/common/clipboardService.js';\n\nexport interface IEnableViewZoneCopySelectionOptions {\n\t/** The view zone HTML element that contains the deleted codes. */\n\tdomNode: HTMLElement;\n\n\t/** Returns the current view zone ID. */\n\tgetViewZoneId: () => string;\n\n\t/** The diff entry for the current view zone. */\n\tdiffEntry: DetailedLineRangeMapping;\n\n\t/** The original text model, to get the original text based on selection. */\n\toriginalModel: ITextModel;\n\n\t/** The line height of the editor, to calculate the line number offset. */\n\teditorLineHeight: number;\n\n\t/** The actual view lines for each editor line (considers line-wrapping). */\n\tviewLineCounts: number[];\n\n\t/** The editor to listen to mouse events on. */\n\teditor: ICodeEditor;\n\n\t/**\n\t * The function to show the context menu.\n\t *\n\t * @param anchor The anchor position for the context menu.\n\t * @param baseActions The base actions to show in the context menu, which will\n\t * include the \"Copy Selection\" option if any text is selected in this\n\t * view zone.\n\t * @param onHide The function to call when the context menu is dismissed.\n\t */\n\tshowContextMenu:\n\t(anchor: { x: number; y: number }, baseActions?: Action[],\n\t\tonHide?: () => void) => void;\n\n\t/** The clipboard service to write the selected text to. */\n\tclipboardService: IClipboardService;\n}\n\nexport function enableCopySelection(options: IEnableViewZoneCopySelectionOptions): DisposableStore {\n\tconst {\n\t\tdomNode,\n\t\tgetViewZoneId,\n\t\tdiffEntry,\n\t\toriginalModel,\n\t\teditorLineHeight,\n\t\tviewLineCounts,\n\t\teditor,\n\t\tshowContextMenu,\n\t\tclipboardService,\n\t} = options;\n\tlet lastMouseDownPosition: Position | undefined;\n\tconst viewZoneDisposable = new DisposableStore();\n\n\tviewZoneDisposable.add(editor.onMouseDown(e => {\n\t\tif (!e.event.leftButton) {\n\t\t\treturn;\n\t\t}\n\t\tif (e.target.type !== MouseTargetType.CONTENT_VIEW_ZONE &&\n\t\t\te.target.type !== MouseTargetType.GUTTER_VIEW_ZONE) {\n\t\t\treturn;\n\t\t}\n\t\tif (e.target.detail.viewZoneId !== getViewZoneId()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst lineNumberOffset = calculateLineNumberOffset(e.event.browserEvent.y, domNode, editorLineHeight, viewLineCounts);\n\t\tconst lineNumber = diffEntry.original.startLineNumber + lineNumberOffset;\n\t\tlastMouseDownPosition = new Position(lineNumber, getRealColumnNumber(e.target.mouseColumn, lineNumber, originalModel));\n\t}));\n\n\tviewZoneDisposable.add(editor.onMouseUp(e => {\n\t\tif (!lastMouseDownPosition) {\n\t\t\treturn;\n\t\t}\n\t\tconst mouseDownPosition = lastMouseDownPosition;\n\t\tlastMouseDownPosition = undefined;\n\n\t\tif (!e.event.leftButton) {\n\t\t\treturn;\n\t\t}\n\t\tif ((e.target.type !== MouseTargetType.CONTENT_VIEW_ZONE &&\n\t\t\te.target.type !== MouseTargetType.GUTTER_VIEW_ZONE) ||\n\t\t\te.target.detail.viewZoneId !== getViewZoneId()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst lineNumberOffset = calculateLineNumberOffset(e.event.browserEvent.y, domNode, editorLineHeight, viewLineCounts);\n\t\tconst lineNumber = diffEntry.original.startLineNumber + lineNumberOffset;\n\t\tconst mouseUpPosition = new Position(lineNumber, getRealColumnNumber(e.target.mouseColumn, lineNumber, originalModel));\n\n\t\tconst range = mouseUpPosition.isBefore(mouseDownPosition) ?\n\t\t\tRange.fromPositions(mouseUpPosition, mouseDownPosition) :\n\t\t\tRange.fromPositions(mouseDownPosition, mouseUpPosition);\n\t\tconst selectedText = originalModel.getValueInRange(range);\n\t\tconst onCopy =\n\t\t\tviewZoneDisposable.add(addDisposableListener(domNode, 'copy', (e) => {\n\t\t\t\te.preventDefault();\n\t\t\t\tclipboardService.writeText(selectedText);\n\t\t\t}));\n\n\t\tshowContextMenu(\n\t\t\t{ x: e.event.posx, y: e.event.posy + editorLineHeight },\n\t\t\tselectedText ?\n\t\t\t\t[new Action(\n\t\t\t\t\t'diff.clipboard.copySelectedDeletedContent',\n\t\t\t\t\tlocalize(\n\t\t\t\t\t\t'diff.clipboard.copySelectedDeletedContent.label',\n\t\t\t\t\t\t'Copy Selection'),\n\t\t\t\t\tundefined, true,\n\t\t\t\t\tasync () => clipboardService.writeText(selectedText))] :\n\t\t\t\t[],\n\t\t\t() => {\n\t\t\t\tonCopy.dispose();\n\t\t\t});\n\t}));\n\treturn viewZoneDisposable;\n}\n\n/**\n * Calculate the line number offset of the given browser event y-coordinate in a\n * view zone.\n *\n * @param y The y-coordinate position of the browser event.\n * @param viewZoneNode The view zone HTML element.\n * @param editorLineHeight The line height of the editor.\n * @param viewLineCounts The actual view lines for each editor line (considers\n * line-wrapping).\n * @return The line number offset in the given view zone.\n */\nfunction calculateLineNumberOffset(\n\ty: number,\n\tviewZoneNode: HTMLElement,\n\teditorLineHeight: number,\n\tviewLineCounts: number[],\n): number {\n\tconst { top } = getDomNodePagePosition(viewZoneNode);\n\tconst offset = y - top;\n\tconst lineNumberOffset = Math.floor(offset / editorLineHeight);\n\n\tlet acc = 0;\n\tfor (let i = 0; i < viewLineCounts.length; i++) {\n\t\tacc += viewLineCounts[i];\n\t\tif (lineNumberOffset < acc) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn lineNumberOffset;\n}\n\n/**\n * Get the real column number of the given mouse column in a view zone. This\n * compensates for different tab sizes.\n *\n * @param mouseColumn The mouse column position of the browser event.\n * @param lineNumber The line number of the original text model.\n * @param textModel The original text model.\n * @return The real column number of the given mouse column in the view zone.\n */\nfunction getRealColumnNumber(\n\tmouseColumn: number,\n\tlineNumber: number,\n\ttextModel: ITextModel,\n) {\n\tconst lineContent = textModel.getLineContent(lineNumber);\n\tlet i = 0;\n\twhile (i < lineContent.length && lineContent[i] === '\\t') { i++; }\n\treturn Math.max(1, mouseColumn - i * (textModel.getOptions().tabSize - 1));\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/copySelection.ts","vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/copySelection.ts"],"names":[],"mappings":"AAA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,CAAC;QAED,MAAM,aAAa,GAAG,iBAAiB,CAAC,kBAAkB,CAAC,YAAY,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;QAC/F,MAAM,WAAW,GAAG,iBAAiB,CAAC,kBAAkB,CAAC,UAAU,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC;QAEzF,IAAI,CAAC,aAAa,IAAI,CAAC,WAAW,EAAE,CAAC;YACpC,OAAO;QACR,CAAC;QAED,MAAM,aAAa,GAAG,aAAa,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC;QAClF,MAAM,WAAW,GAAG,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC;QAE9E,MAAM,KAAK,GAAG,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;YAClD,KAAK,CAAC,aAAa,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC;YACjD,KAAK,CAAC,aAAa,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;QAEjD,MAAM,YAAY,GAAG,aAAa,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QAC1D,gBAAgB,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC,CAAC;IAEJ,OAAO,kBAAkB,CAAC;AAC3B,CAAC","file":"copySelection.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 { DisposableStore } from '../../../../../../base/common/lifecycle.js';\nimport { Range } from '../../../../../common/core/range.js';\nimport { DetailedLineRangeMapping } from '../../../../../common/diff/rangeMapping.js';\nimport { ITextModel } from '../../../../../common/model.js';\nimport { IClipboardService } from '../../../../../../platform/clipboard/common/clipboardService.js';\nimport { RenderLinesResult } from './renderLines.js';\n\nexport interface IEnableViewZoneCopySelectionOptions {\n\t/** The view zone HTML element that contains the deleted codes. */\n\tdomNode: HTMLElement;\n\n\t/** The diff entry for the current view zone. */\n\tdiffEntry: DetailedLineRangeMapping;\n\n\t/** The original text model, to get the original text based on selection. */\n\toriginalModel: ITextModel;\n\n\t/** The render lines result that can translate DOM positions to model positions. */\n\trenderLinesResult: RenderLinesResult;\n\n\t/** The clipboard service to write the selected text to. */\n\tclipboardService: IClipboardService;\n}\n\nexport function enableCopySelection(options: IEnableViewZoneCopySelectionOptions): DisposableStore {\n\tconst { domNode, renderLinesResult, diffEntry, originalModel, clipboardService } = options;\n\tconst viewZoneDisposable = new DisposableStore();\n\n\tviewZoneDisposable.add(addDisposableListener(domNode, 'copy', (e) => {\n\t\te.preventDefault();\n\t\tconst selection = domNode.ownerDocument.getSelection();\n\t\tif (!selection || selection.rangeCount === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst domRange = selection.getRangeAt(0);\n\t\tif (!domRange || domRange.collapsed) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst startElement = domRange.startContainer.nodeType === Node.TEXT_NODE\n\t\t\t? domRange.startContainer.parentElement\n\t\t\t: domRange.startContainer as HTMLElement;\n\t\tconst endElement = domRange.endContainer.nodeType === Node.TEXT_NODE\n\t\t\t? domRange.endContainer.parentElement\n\t\t\t: domRange.endContainer as HTMLElement;\n\n\t\tif (!startElement || !endElement) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst startPosition = renderLinesResult.getModelPositionAt(startElement, domRange.startOffset);\n\t\tconst endPosition = renderLinesResult.getModelPositionAt(endElement, domRange.endOffset);\n\n\t\tif (!startPosition || !endPosition) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst adjustedStart = startPosition.delta(diffEntry.original.startLineNumber - 1);\n\t\tconst adjustedEnd = endPosition.delta(diffEntry.original.startLineNumber - 1);\n\n\t\tconst range = adjustedEnd.isBefore(adjustedStart) ?\n\t\t\tRange.fromPositions(adjustedEnd, adjustedStart) :\n\t\t\tRange.fromPositions(adjustedStart, adjustedEnd);\n\n\t\tconst selectedText = originalModel.getValueInRange(range);\n\t\tclipboardService.writeText(selectedText);\n\t}));\n\n\treturn viewZoneDisposable;\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 { DisposableStore } from '../../../../../../base/common/lifecycle.js';\nimport { Range } from '../../../../../common/core/range.js';\nimport { DetailedLineRangeMapping } from '../../../../../common/diff/rangeMapping.js';\nimport { ITextModel } from '../../../../../common/model.js';\nimport { IClipboardService } from '../../../../../../platform/clipboard/common/clipboardService.js';\nimport { RenderLinesResult } from './renderLines.js';\n\nexport interface IEnableViewZoneCopySelectionOptions {\n\t/** The view zone HTML element that contains the deleted codes. */\n\tdomNode: HTMLElement;\n\n\t/** The diff entry for the current view zone. */\n\tdiffEntry: DetailedLineRangeMapping;\n\n\t/** The original text model, to get the original text based on selection. */\n\toriginalModel: ITextModel;\n\n\t/** The render lines result that can translate DOM positions to model positions. */\n\trenderLinesResult: RenderLinesResult;\n\n\t/** The clipboard service to write the selected text to. */\n\tclipboardService: IClipboardService;\n}\n\nexport function enableCopySelection(options: IEnableViewZoneCopySelectionOptions): DisposableStore {\n\tconst { domNode, renderLinesResult, diffEntry, originalModel, clipboardService } = options;\n\tconst viewZoneDisposable = new DisposableStore();\n\n\tviewZoneDisposable.add(addDisposableListener(domNode, 'copy', (e) => {\n\t\te.preventDefault();\n\t\tconst selection = domNode.ownerDocument.getSelection();\n\t\tif (!selection || selection.rangeCount === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst domRange = selection.getRangeAt(0);\n\t\tif (!domRange || domRange.collapsed) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst startElement = domRange.startContainer.nodeType === Node.TEXT_NODE\n\t\t\t? domRange.startContainer.parentElement\n\t\t\t: domRange.startContainer as HTMLElement;\n\t\tconst endElement = domRange.endContainer.nodeType === Node.TEXT_NODE\n\t\t\t? domRange.endContainer.parentElement\n\t\t\t: domRange.endContainer as HTMLElement;\n\n\t\tif (!startElement || !endElement) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst startPosition = renderLinesResult.getModelPositionAt(startElement, domRange.startOffset);\n\t\tconst endPosition = renderLinesResult.getModelPositionAt(endElement, domRange.endOffset);\n\n\t\tif (!startPosition || !endPosition) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst adjustedStart = startPosition.delta(diffEntry.original.startLineNumber - 1);\n\t\tconst adjustedEnd = endPosition.delta(diffEntry.original.startLineNumber - 1);\n\n\t\tconst range = adjustedEnd.isBefore(adjustedStart) ?\n\t\t\tRange.fromPositions(adjustedEnd, adjustedStart) :\n\t\t\tRange.fromPositions(adjustedStart, adjustedEnd);\n\n\t\tconst selectedText = originalModel.getValueInRange(range);\n\t\tclipboardService.writeText(selectedText);\n\t}));\n\n\treturn viewZoneDisposable;\n}\n"]}
|
|
@@ -188,7 +188,7 @@ let DiffEditorViewZones = class DiffEditorViewZones extends Disposable {
|
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
let zoneId = undefined;
|
|
191
|
-
alignmentViewZonesDisposables.add(new InlineDiffDeletedCodeMargin(() => assertReturnsDefined(zoneId), marginDomNode, deletedCodeDomNode, this._editors.modified, a.diff, this._diffEditorWidget, result
|
|
191
|
+
alignmentViewZonesDisposables.add(new InlineDiffDeletedCodeMargin(() => assertReturnsDefined(zoneId), marginDomNode, deletedCodeDomNode, this._editors.modified, a.diff, this._diffEditorWidget, result, this._editors.original.getModel(), this._contextMenuService, this._clipboardService));
|
|
192
192
|
for (let i = 0; i < result.viewLineCounts.length; i++) {
|
|
193
193
|
const count = result.viewLineCounts[i];
|
|
194
194
|
// Account for wrapped lines in the (collapsed) original editor (which doesn't wrap lines).
|
|
@@ -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,OA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CAAC,YAAY,CAAC,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', 'line-delete-selectable', '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\tdeletedCodeDomNode,\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: false,\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', 'line-delete-selectable', '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\tdeletedCodeDomNode,\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: false,\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"]}
|
|
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,aA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AAM,MAAM,GAAG,WAAW,CACzB,eAAe,EACf,mBAAmB,EACnB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,EACjB,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,UAAU,EAAE,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,EAAE,CAAC,UAAU,GAAG,EAAE,CAAC,UAAU,EAAE,CAAC,CACtF,CAAC;IAEF,OAAO,MAAM,CAAC;AACf,CAAC;AAED,MAAM,UAAU,6BAA6B,CAAC,OAAiC;IAC9E,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC;IACd,CAAC;IACD,OAAO,OAAO,CAAC,YAAY,CAAC,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', 'line-delete-selectable', '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\tdeletedCodeDomNode,\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,\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: false,\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', 'line-delete-selectable', '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\tdeletedCodeDomNode,\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,\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: false,\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"]}
|