monaco-editor-core 0.55.0-dev-20251014 → 0.55.0-dev-20251016
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 +9 -0
- 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 +9 -0
- package/esm/nls.messages.pt-br.js +9 -0
- package/esm/nls.messages.ru.js +2 -2
- package/esm/nls.messages.tr.js +9 -0
- package/esm/nls.messages.zh-cn.js +2 -2
- package/esm/nls.messages.zh-tw.js +2 -2
- package/esm/nls.metadata.json +10 -0
- package/esm/vs/base/browser/canIUse.js +0 -1
- package/esm/vs/base/browser/canIUse.js.map +1 -1
- package/esm/vs/base/browser/domSanitize.js +31 -23
- package/esm/vs/base/browser/domSanitize.js.map +1 -1
- package/esm/vs/base/browser/dompurify/dompurify.js +188 -385
- package/esm/vs/base/browser/markdownRenderer.js +6 -1
- package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
- package/esm/vs/base/browser/trustedTypes.js.map +1 -1
- package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/esm/vs/base/browser/ui/toggle/toggle.js +6 -0
- package/esm/vs/base/browser/ui/toggle/toggle.js.map +1 -1
- package/esm/vs/base/common/codiconsLibrary.js +1 -0
- package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
- package/esm/vs/base/common/objects.js +0 -1
- package/esm/vs/base/common/objects.js.map +1 -1
- package/esm/vs/editor/browser/controller/mouseTarget.js +2 -1
- package/esm/vs/editor/browser/controller/mouseTarget.js.map +1 -1
- package/esm/vs/editor/browser/coreCommands.js +4 -2
- package/esm/vs/editor/browser/coreCommands.js.map +1 -1
- package/esm/vs/editor/browser/services/abstractCodeEditorService.js +5 -0
- package/esm/vs/editor/browser/services/abstractCodeEditorService.js.map +1 -1
- package/esm/vs/editor/browser/services/codeEditorService.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/copySelection.js +104 -0
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/copySelection.js.map +1 -0
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.js +3 -3
- 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 +25 -24
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/diffEditor.contribution.js +5 -5
- package/esm/vs/editor/browser/widget/diffEditor/diffEditorWidget.js +7 -3
- package/esm/vs/editor/browser/widget/diffEditor/diffEditorWidget.js.map +1 -1
- 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/diffEditor/style.css +11 -0
- package/esm/vs/editor/browser/widget/multiDiffEditor/colors.js +3 -3
- 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 +406 -406
- package/esm/vs/editor/common/core/editorColorRegistry.js +68 -68
- package/esm/vs/editor/common/cursor/cursorMoveCommands.js +10 -1
- package/esm/vs/editor/common/cursor/cursorMoveCommands.js.map +1 -1
- package/esm/vs/editor/common/editorContextKeys.js +46 -46
- 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/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/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 +13 -14
- package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js.map +1 -1
- 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/foldingDecorations.js +9 -9
- package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js.map +1 -1
- package/esm/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
- 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/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 +19 -19
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +12 -12
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +15 -10
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +1 -1
- 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 +47 -37
- package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js.map +1 -1
- 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 +56 -10
- package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js.map +1 -1
- 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/stickyScroll/browser/stickyScrollWidget.js +2 -2
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js.map +1 -1
- 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/actions.js +0 -1
- package/esm/vs/platform/actions/common/actions.js.map +1 -1
- 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/keybinding/common/abstractKeybindingService.js +4 -4
- package/esm/vs/platform/list/browser/listService.js +27 -27
- 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/quickinput/common/quickInput.js.map +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 +15 -15
- 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 +3 -3
- package/version.txt +1 -1
|
@@ -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,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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', 'monaco-mouse-cursor-text');\n\t\t\t\t\t\tconst originalModel = this._editors.original.getModel()!;\n\t\t\t\t\t\t// `a.originalRange` can be out of bound when the diff has not been updated yet.\n\t\t\t\t\t\t// In this case, we do an early return.\n\t\t\t\t\t\t// TODO@hediet: Fix this by applying the edit directly to the diff model, so that the diff is always valid.\n\t\t\t\t\t\tif (a.originalRange.endLineNumberExclusive - 1 > originalModel.getLineCount()) {\n\t\t\t\t\t\t\treturn { orig: origViewZones, mod: modViewZones };\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst source = new LineSource(\n\t\t\t\t\t\t\ta.originalRange.mapToLineArray(l => originalModel.tokenization.getLineTokens(l)),\n\t\t\t\t\t\t\ta.originalRange.mapToLineArray(_ => lineBreakData[lineBreakDataIdx++]),\n\t\t\t\t\t\t\tmightContainNonBasicASCII,\n\t\t\t\t\t\t\tmightContainRTL,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst decorations: InlineDecoration[] = [];\n\t\t\t\t\t\tfor (const i of a.diff.innerChanges || []) {\n\t\t\t\t\t\t\tdecorations.push(new InlineDecoration(\n\t\t\t\t\t\t\t\ti.originalRange.delta(-(a.diff.original.startLineNumber - 1)),\n\t\t\t\t\t\t\t\tdiffDeleteDecoration.className!,\n\t\t\t\t\t\t\t\tInlineDecorationType.Regular\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst result = renderLines(source, renderOptions, decorations, deletedCodeDomNode);\n\n\t\t\t\t\t\tconst marginDomNode = document.createElement('div');\n\t\t\t\t\t\tmarginDomNode.className = 'inline-deleted-margin-view-zone';\n\t\t\t\t\t\tapplyFontInfo(marginDomNode, renderOptions.fontInfo);\n\n\t\t\t\t\t\tif (this._options.renderIndicators.read(reader)) {\n\t\t\t\t\t\t\tfor (let i = 0; i < result.heightInLines; i++) {\n\t\t\t\t\t\t\t\tconst marginElement = document.createElement('div');\n\t\t\t\t\t\t\t\tmarginElement.className = `delete-sign ${ThemeIcon.asClassName(diffRemoveIcon)}`;\n\t\t\t\t\t\t\t\tmarginElement.setAttribute('style', `position:absolute;top:${i * modLineHeight}px;width:${renderOptions.lineDecorationsWidth}px;height:${modLineHeight}px;right:0;`);\n\t\t\t\t\t\t\t\tmarginDomNode.appendChild(marginElement);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet zoneId: string | undefined = undefined;\n\t\t\t\t\t\talignmentViewZonesDisposables.add(\n\t\t\t\t\t\t\tnew InlineDiffDeletedCodeMargin(\n\t\t\t\t\t\t\t\t() => assertReturnsDefined(zoneId),\n\t\t\t\t\t\t\t\tmarginDomNode,\n\t\t\t\t\t\t\t\tthis._editors.modified,\n\t\t\t\t\t\t\t\ta.diff,\n\t\t\t\t\t\t\t\tthis._diffEditorWidget,\n\t\t\t\t\t\t\t\tresult.viewLineCounts,\n\t\t\t\t\t\t\t\tthis._editors.original.getModel()!,\n\t\t\t\t\t\t\t\tthis._contextMenuService,\n\t\t\t\t\t\t\t\tthis._clipboardService,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tfor (let i = 0; i < result.viewLineCounts.length; i++) {\n\t\t\t\t\t\t\tconst count = result.viewLineCounts[i];\n\t\t\t\t\t\t\t// Account for wrapped lines in the (collapsed) original editor (which doesn't wrap lines).\n\t\t\t\t\t\t\tif (count > 1) {\n\t\t\t\t\t\t\t\torigViewZones.push({\n\t\t\t\t\t\t\t\t\tafterLineNumber: a.originalRange.startLineNumber + i,\n\t\t\t\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\t\t\t\theightInPx: (count - 1) * modLineHeight,\n\t\t\t\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmodViewZones.push({\n\t\t\t\t\t\t\tafterLineNumber: a.modifiedRange.startLineNumber - 1,\n\t\t\t\t\t\t\tdomNode: deletedCodeDomNode,\n\t\t\t\t\t\t\theightInPx: result.heightInLines * modLineHeight,\n\t\t\t\t\t\t\tminWidthInPx: result.minWidthInPx,\n\t\t\t\t\t\t\tmarginDomNode,\n\t\t\t\t\t\t\tsetZoneId(id) { zoneId = id; },\n\t\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tconst marginDomNode = document.createElement('div');\n\t\t\t\t\tmarginDomNode.className = 'gutter-delete';\n\n\t\t\t\t\torigViewZones.push({\n\t\t\t\t\t\tafterLineNumber: a.originalRange.endLineNumberExclusive - 1,\n\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\theightInPx: a.modifiedHeightInPx,\n\t\t\t\t\t\tmarginDomNode,\n\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tconst delta = a.modifiedHeightInPx - a.originalHeightInPx;\n\t\t\t\t\tif (delta > 0) {\n\t\t\t\t\t\tif (syncedMovedText?.lineRangeMapping.original.delta(-1).deltaLength(2).contains(a.originalRange.endLineNumberExclusive - 1)) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\torigViewZones.push({\n\t\t\t\t\t\t\tafterLineNumber: a.originalRange.endLineNumberExclusive - 1,\n\t\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\t\theightInPx: delta,\n\t\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (syncedMovedText?.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(a.modifiedRange.endLineNumberExclusive - 1)) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction createViewZoneMarginArrow(): HTMLElement {\n\t\t\t\t\t\t\tconst arrow = document.createElement('div');\n\t\t\t\t\t\t\tarrow.className = 'arrow-revert-change ' + ThemeIcon.asClassName(Codicon.arrowRight);\n\t\t\t\t\t\t\treader.store.add(addDisposableListener(arrow, 'mousedown', e => e.stopPropagation()));\n\t\t\t\t\t\t\treader.store.add(addDisposableListener(arrow, 'click', e => {\n\t\t\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\t\t\t_diffEditorWidget.revert(a.diff!);\n\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t\treturn $('div', {}, arrow);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet marginDomNode: HTMLElement | undefined = undefined;\n\t\t\t\t\t\tif (a.diff && a.diff.modified.isEmpty && this._options.shouldRenderOldRevertArrows.read(reader)) {\n\t\t\t\t\t\t\tmarginDomNode = createViewZoneMarginArrow();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmodViewZones.push({\n\t\t\t\t\t\t\tafterLineNumber: a.modifiedRange.endLineNumberExclusive - 1,\n\t\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\t\theightInPx: -delta,\n\t\t\t\t\t\t\tmarginDomNode,\n\t\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (const a of alignmentsSyncedMovedText.read(reader) ?? []) {\n\t\t\t\tif (!syncedMovedText?.lineRangeMapping.original.intersect(a.originalRange)\n\t\t\t\t\t|| !syncedMovedText?.lineRangeMapping.modified.intersect(a.modifiedRange)) {\n\t\t\t\t\t// ignore unrelated alignments outside the synced moved text\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst delta = a.modifiedHeightInPx - a.originalHeightInPx;\n\t\t\t\tif (delta > 0) {\n\t\t\t\t\torigViewZones.push({\n\t\t\t\t\t\tafterLineNumber: a.originalRange.endLineNumberExclusive - 1,\n\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\theightInPx: delta,\n\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tmodViewZones.push({\n\t\t\t\t\t\tafterLineNumber: a.modifiedRange.endLineNumberExclusive - 1,\n\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\theightInPx: -delta,\n\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn { orig: origViewZones, mod: modViewZones };\n\t\t});\n\n\t\tlet ignoreChange = false;\n\t\tthis._register(this._editors.original.onDidScrollChange(e => {\n\t\t\tif (e.scrollLeftChanged && !ignoreChange) {\n\t\t\t\tignoreChange = true;\n\t\t\t\tthis._editors.modified.setScrollLeft(e.scrollLeft);\n\t\t\t\tignoreChange = false;\n\t\t\t}\n\t\t}));\n\t\tthis._register(this._editors.modified.onDidScrollChange(e => {\n\t\t\tif (e.scrollLeftChanged && !ignoreChange) {\n\t\t\t\tignoreChange = true;\n\t\t\t\tthis._editors.original.setScrollLeft(e.scrollLeft);\n\t\t\t\tignoreChange = false;\n\t\t\t}\n\t\t}));\n\n\t\tthis._originalScrollTop = observableFromEvent(this._editors.original.onDidScrollChange, () => /** @description original.getScrollTop */ this._editors.original.getScrollTop());\n\t\tthis._modifiedScrollTop = observableFromEvent(this._editors.modified.onDidScrollChange, () => /** @description modified.getScrollTop */ this._editors.modified.getScrollTop());\n\n\t\t// origExtraHeight + origOffset - origScrollTop = modExtraHeight + modOffset - modScrollTop\n\n\t\t// origScrollTop = origExtraHeight + origOffset - modExtraHeight - modOffset + modScrollTop\n\t\t// modScrollTop = modExtraHeight + modOffset - origExtraHeight - origOffset + origScrollTop\n\n\t\t// origOffset - modOffset = heightOfLines(1..Y) - heightOfLines(1..X)\n\t\t// origScrollTop >= 0, modScrollTop >= 0\n\n\t\tthis._register(autorun(reader => {\n\t\t\t/** @description update scroll modified */\n\t\t\tconst newScrollTopModified = this._originalScrollTop.read(reader)\n\t\t\t\t- (this._originalScrollOffsetAnimated.read(undefined) - this._modifiedScrollOffsetAnimated.read(reader))\n\t\t\t\t- (this._originalTopPadding.read(undefined) - this._modifiedTopPadding.read(reader));\n\t\t\tif (newScrollTopModified !== this._editors.modified.getScrollTop()) {\n\t\t\t\tthis._editors.modified.setScrollTop(newScrollTopModified, ScrollType.Immediate);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\t/** @description update scroll original */\n\t\t\tconst newScrollTopOriginal = this._modifiedScrollTop.read(reader)\n\t\t\t\t- (this._modifiedScrollOffsetAnimated.read(undefined) - this._originalScrollOffsetAnimated.read(reader))\n\t\t\t\t- (this._modifiedTopPadding.read(undefined) - this._originalTopPadding.read(reader));\n\t\t\tif (newScrollTopOriginal !== this._editors.original.getScrollTop()) {\n\t\t\t\tthis._editors.original.setScrollTop(newScrollTopOriginal, ScrollType.Immediate);\n\t\t\t}\n\t\t}));\n\n\n\t\tthis._register(autorun(reader => {\n\t\t\t/** @description update editor top offsets */\n\t\t\tconst m = this._diffModel.read(reader)?.movedTextToCompare.read(reader);\n\n\t\t\tlet deltaOrigToMod = 0;\n\t\t\tif (m) {\n\t\t\t\tconst trueTopOriginal = this._editors.original.getTopForLineNumber(m.lineRangeMapping.original.startLineNumber, true) - this._originalTopPadding.read(undefined);\n\t\t\t\tconst trueTopModified = this._editors.modified.getTopForLineNumber(m.lineRangeMapping.modified.startLineNumber, true) - this._modifiedTopPadding.read(undefined);\n\t\t\t\tdeltaOrigToMod = trueTopModified - trueTopOriginal;\n\t\t\t}\n\n\t\t\tif (deltaOrigToMod > 0) {\n\t\t\t\tthis._modifiedTopPadding.set(0, undefined);\n\t\t\t\tthis._originalTopPadding.set(deltaOrigToMod, undefined);\n\t\t\t} else if (deltaOrigToMod < 0) {\n\t\t\t\tthis._modifiedTopPadding.set(-deltaOrigToMod, undefined);\n\t\t\t\tthis._originalTopPadding.set(0, undefined);\n\t\t\t} else {\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tthis._modifiedTopPadding.set(0, undefined);\n\t\t\t\t\tthis._originalTopPadding.set(0, undefined);\n\t\t\t\t}, 400);\n\t\t\t}\n\n\t\t\tif (this._editors.modified.hasTextFocus()) {\n\t\t\t\tthis._originalScrollOffset.set(this._modifiedScrollOffset.read(undefined) - deltaOrigToMod, undefined, true);\n\t\t\t} else {\n\t\t\t\tthis._modifiedScrollOffset.set(this._originalScrollOffset.read(undefined) + deltaOrigToMod, undefined, true);\n\t\t\t}\n\t\t}));\n\t}\n}\n\ninterface ILineRangeAlignment {\n\toriginalRange: LineRange;\n\tmodifiedRange: LineRange;\n\n\t// accounts for foreign viewzones and line wrapping\n\toriginalHeightInPx: number;\n\tmodifiedHeightInPx: number;\n\n\t/**\n\t * If this range alignment is a direct result of a diff, then this is the diff's line mapping.\n\t * Only used for inline-view.\n\t */\n\tdiff?: DetailedLineRangeMapping;\n}\n\nfunction computeRangeAlignment(\n\toriginalEditor: CodeEditorWidget,\n\tmodifiedEditor: CodeEditorWidget,\n\tdiffs: readonly DiffMapping[],\n\toriginalEditorAlignmentViewZones: ReadonlySet<string>,\n\tmodifiedEditorAlignmentViewZones: ReadonlySet<string>,\n\tinnerHunkAlignment: boolean,\n): ILineRangeAlignment[] {\n\tconst originalLineHeightOverrides = new ArrayQueue(getAdditionalLineHeights(originalEditor, originalEditorAlignmentViewZones));\n\tconst modifiedLineHeightOverrides = new ArrayQueue(getAdditionalLineHeights(modifiedEditor, modifiedEditorAlignmentViewZones));\n\n\tconst origLineHeight = originalEditor.getOption(EditorOption.lineHeight);\n\tconst modLineHeight = modifiedEditor.getOption(EditorOption.lineHeight);\n\n\tconst result: ILineRangeAlignment[] = [];\n\n\tlet lastOriginalLineNumber = 0;\n\tlet lastModifiedLineNumber = 0;\n\n\tfunction handleAlignmentsOutsideOfDiffs(untilOriginalLineNumberExclusive: number, untilModifiedLineNumberExclusive: number) {\n\t\twhile (true) {\n\t\t\tlet origNext = originalLineHeightOverrides.peek();\n\t\t\tlet modNext = modifiedLineHeightOverrides.peek();\n\t\t\tif (origNext && origNext.lineNumber >= untilOriginalLineNumberExclusive) {\n\t\t\t\torigNext = undefined;\n\t\t\t}\n\t\t\tif (modNext && modNext.lineNumber >= untilModifiedLineNumberExclusive) {\n\t\t\t\tmodNext = undefined;\n\t\t\t}\n\t\t\tif (!origNext && !modNext) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst distOrig = origNext ? origNext.lineNumber - lastOriginalLineNumber : Number.MAX_VALUE;\n\t\t\tconst distNext = modNext ? modNext.lineNumber - lastModifiedLineNumber : Number.MAX_VALUE;\n\n\t\t\tif (distOrig < distNext) {\n\t\t\t\toriginalLineHeightOverrides.dequeue();\n\t\t\t\tmodNext = {\n\t\t\t\t\tlineNumber: origNext!.lineNumber - lastOriginalLineNumber + lastModifiedLineNumber,\n\t\t\t\t\theightInPx: 0,\n\t\t\t\t};\n\t\t\t} else if (distOrig > distNext) {\n\t\t\t\tmodifiedLineHeightOverrides.dequeue();\n\t\t\t\torigNext = {\n\t\t\t\t\tlineNumber: modNext!.lineNumber - lastModifiedLineNumber + lastOriginalLineNumber,\n\t\t\t\t\theightInPx: 0,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\toriginalLineHeightOverrides.dequeue();\n\t\t\t\tmodifiedLineHeightOverrides.dequeue();\n\t\t\t}\n\n\t\t\tresult.push({\n\t\t\t\toriginalRange: LineRange.ofLength(origNext!.lineNumber, 1),\n\t\t\t\tmodifiedRange: LineRange.ofLength(modNext!.lineNumber, 1),\n\t\t\t\toriginalHeightInPx: origLineHeight + origNext!.heightInPx,\n\t\t\t\tmodifiedHeightInPx: modLineHeight + modNext!.heightInPx,\n\t\t\t\tdiff: undefined,\n\t\t\t});\n\t\t}\n\t}\n\n\tfor (const m of diffs) {\n\t\tconst c = m.lineRangeMapping;\n\t\thandleAlignmentsOutsideOfDiffs(c.original.startLineNumber, c.modified.startLineNumber);\n\n\t\tlet first = true;\n\t\tlet lastModLineNumber = c.modified.startLineNumber;\n\t\tlet lastOrigLineNumber = c.original.startLineNumber;\n\n\t\tfunction emitAlignment(origLineNumberExclusive: number, modLineNumberExclusive: number, forceAlignment = false) {\n\t\t\tif (origLineNumberExclusive < lastOrigLineNumber || modLineNumberExclusive < lastModLineNumber) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (first) {\n\t\t\t\tfirst = false;\n\t\t\t} else if (!forceAlignment && (origLineNumberExclusive === lastOrigLineNumber || modLineNumberExclusive === lastModLineNumber)) {\n\t\t\t\t// This causes a re-alignment of an already aligned line.\n\t\t\t\t// However, we don't care for the final alignment.\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst originalRange = new LineRange(lastOrigLineNumber, origLineNumberExclusive);\n\t\t\tconst modifiedRange = new LineRange(lastModLineNumber, modLineNumberExclusive);\n\t\t\tif (originalRange.isEmpty && modifiedRange.isEmpty) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst originalAdditionalHeight = originalLineHeightOverrides\n\t\t\t\t.takeWhile(v => v.lineNumber < origLineNumberExclusive)\n\t\t\t\t?.reduce((p, c) => p + c.heightInPx, 0) ?? 0;\n\t\t\tconst modifiedAdditionalHeight = modifiedLineHeightOverrides\n\t\t\t\t.takeWhile(v => v.lineNumber < modLineNumberExclusive)\n\t\t\t\t?.reduce((p, c) => p + c.heightInPx, 0) ?? 0;\n\n\t\t\tresult.push({\n\t\t\t\toriginalRange,\n\t\t\t\tmodifiedRange,\n\t\t\t\toriginalHeightInPx: originalRange.length * origLineHeight + originalAdditionalHeight,\n\t\t\t\tmodifiedHeightInPx: modifiedRange.length * modLineHeight + modifiedAdditionalHeight,\n\t\t\t\tdiff: m.lineRangeMapping,\n\t\t\t});\n\n\t\t\tlastOrigLineNumber = origLineNumberExclusive;\n\t\t\tlastModLineNumber = modLineNumberExclusive;\n\t\t}\n\n\t\tif (innerHunkAlignment) {\n\t\t\tfor (const i of c.innerChanges || []) {\n\t\t\t\tif (i.originalRange.startColumn > 1 && i.modifiedRange.startColumn > 1) {\n\t\t\t\t\t// There is some unmodified text on this line before the diff\n\t\t\t\t\temitAlignment(i.originalRange.startLineNumber, i.modifiedRange.startLineNumber);\n\t\t\t\t}\n\t\t\t\tconst originalModel = originalEditor.getModel()!;\n\t\t\t\t// When the diff is invalid, the ranges might be out of bounds (this should be fixed in the diff model by applying edits directly).\n\t\t\t\tconst maxColumn = i.originalRange.endLineNumber <= originalModel.getLineCount() ? originalModel.getLineMaxColumn(i.originalRange.endLineNumber) : Number.MAX_SAFE_INTEGER;\n\t\t\t\tif (i.originalRange.endColumn < maxColumn) {\n\t\t\t\t\t// // There is some unmodified text on this line after the diff\n\t\t\t\t\temitAlignment(i.originalRange.endLineNumber, i.modifiedRange.endLineNumber);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\temitAlignment(c.original.endLineNumberExclusive, c.modified.endLineNumberExclusive, true);\n\n\t\tlastOriginalLineNumber = c.original.endLineNumberExclusive;\n\t\tlastModifiedLineNumber = c.modified.endLineNumberExclusive;\n\t}\n\thandleAlignmentsOutsideOfDiffs(Number.MAX_VALUE, Number.MAX_VALUE);\n\n\treturn result;\n}\n\ninterface AdditionalLineHeightInfo {\n\tlineNumber: number;\n\theightInPx: number;\n}\n\nfunction getAdditionalLineHeights(editor: CodeEditorWidget, viewZonesToIgnore: ReadonlySet<string>): readonly AdditionalLineHeightInfo[] {\n\tconst viewZoneHeights: { lineNumber: number; heightInPx: number }[] = [];\n\tconst wrappingZoneHeights: { lineNumber: number; heightInPx: number }[] = [];\n\n\tconst hasWrapping = editor.getOption(EditorOption.wrappingInfo).wrappingColumn !== -1;\n\tconst coordinatesConverter = editor._getViewModel()!.coordinatesConverter;\n\tconst editorLineHeight = editor.getOption(EditorOption.lineHeight);\n\tif (hasWrapping) {\n\t\tfor (let i = 1; i <= editor.getModel()!.getLineCount(); i++) {\n\t\t\tconst lineCount = coordinatesConverter.getModelLineViewLineCount(i);\n\t\t\tif (lineCount > 1) {\n\t\t\t\twrappingZoneHeights.push({ lineNumber: i, heightInPx: editorLineHeight * (lineCount - 1) });\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (const w of editor.getWhitespaces()) {\n\t\tif (viewZonesToIgnore.has(w.id)) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst modelLineNumber = w.afterLineNumber === 0 ? 0 : coordinatesConverter.convertViewPositionToModelPosition(\n\t\t\tnew Position(w.afterLineNumber, 1)\n\t\t).lineNumber;\n\t\tviewZoneHeights.push({ lineNumber: modelLineNumber, heightInPx: w.height });\n\t}\n\n\tconst result = joinCombine(\n\t\tviewZoneHeights,\n\t\twrappingZoneHeights,\n\t\tv => v.lineNumber,\n\t\t(v1, v2) => ({ lineNumber: v1.lineNumber, heightInPx: v1.heightInPx + v2.heightInPx })\n\t);\n\n\treturn result;\n}\n\nexport function allowsTrueInlineDiffRendering(mapping: DetailedLineRangeMapping): boolean {\n\tif (!mapping.innerChanges) {\n\t\treturn false;\n\t}\n\treturn mapping.innerChanges.every(c =>\n\t\t(rangeIsSingleLine(c.modifiedRange) && rangeIsSingleLine(c.originalRange))\n\t\t|| c.originalRange.equalsRange(new Range(1, 1, 1, 1))\n\t);\n}\n\nexport function rangeIsSingleLine(range: Range): boolean {\n\treturn range.startLineNumber === range.endLineNumber;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { $, addDisposableListener } from '../../../../../../base/browser/dom.js';\nimport { ArrayQueue } from '../../../../../../base/common/arrays.js';\nimport { RunOnceScheduler } from '../../../../../../base/common/async.js';\nimport { Codicon } from '../../../../../../base/common/codicons.js';\nimport { Disposable, DisposableStore } from '../../../../../../base/common/lifecycle.js';\nimport { IObservable, autorun, derived, observableFromEvent, observableValue } from '../../../../../../base/common/observable.js';\nimport { ThemeIcon } from '../../../../../../base/common/themables.js';\nimport { assertReturnsDefined } from '../../../../../../base/common/types.js';\nimport { applyFontInfo } from '../../../../config/domFontInfo.js';\nimport { CodeEditorWidget } from '../../../codeEditor/codeEditorWidget.js';\nimport { diffDeleteDecoration, diffRemoveIcon } from '../../registrations.contribution.js';\nimport { DiffEditorEditors } from '../diffEditorEditors.js';\nimport { DiffEditorViewModel, DiffMapping } from '../../diffEditorViewModel.js';\nimport { DiffEditorWidget } from '../../diffEditorWidget.js';\nimport { InlineDiffDeletedCodeMargin } from './inlineDiffDeletedCodeMargin.js';\nimport { LineSource, RenderOptions, renderLines } from './renderLines.js';\nimport { IObservableViewZone, animatedObservable, joinCombine } from '../../utils.js';\nimport { EditorOption } from '../../../../../common/config/editorOptions.js';\nimport { LineRange } from '../../../../../common/core/ranges/lineRange.js';\nimport { Position } from '../../../../../common/core/position.js';\nimport { DetailedLineRangeMapping } from '../../../../../common/diff/rangeMapping.js';\nimport { ScrollType } from '../../../../../common/editorCommon.js';\nimport { BackgroundTokenizationState } from '../../../../../common/tokenizationTextModelPart.js';\nimport { IClipboardService } from '../../../../../../platform/clipboard/common/clipboardService.js';\nimport { IContextMenuService } from '../../../../../../platform/contextview/browser/contextView.js';\nimport { DiffEditorOptions } from '../../diffEditorOptions.js';\nimport { Range } from '../../../../../common/core/range.js';\nimport { InlineDecoration, InlineDecorationType } from '../../../../../common/viewModel/inlineDecorations.js';\n\n/**\n * Ensures both editors have the same height by aligning unchanged lines.\n * In inline view mode, inserts viewzones to show deleted code from the original text model in the modified code editor.\n * Synchronizes scrolling.\n *\n * Make sure to add the view zones!\n */\nexport class DiffEditorViewZones extends Disposable {\n\tprivate readonly _originalTopPadding;\n\tprivate readonly _originalScrollTop: IObservable<number>;\n\tprivate readonly _originalScrollOffset;\n\tprivate readonly _originalScrollOffsetAnimated;\n\n\tprivate readonly _modifiedTopPadding;\n\tprivate readonly _modifiedScrollTop: IObservable<number>;\n\tprivate readonly _modifiedScrollOffset;\n\tprivate readonly _modifiedScrollOffsetAnimated;\n\n\tpublic readonly viewZones: IObservable<{ orig: IObservableViewZone[]; mod: IObservableViewZone[] }>;\n\n\tconstructor(\n\t\tprivate readonly _targetWindow: Window,\n\t\tprivate readonly _editors: DiffEditorEditors,\n\t\tprivate readonly _diffModel: IObservable<DiffEditorViewModel | undefined>,\n\t\tprivate readonly _options: DiffEditorOptions,\n\t\tprivate readonly _diffEditorWidget: DiffEditorWidget,\n\t\tprivate readonly _canIgnoreViewZoneUpdateEvent: () => boolean,\n\t\tprivate readonly _origViewZonesToIgnore: Set<string>,\n\t\tprivate readonly _modViewZonesToIgnore: Set<string>,\n\t\t@IClipboardService private readonly _clipboardService: IClipboardService,\n\t\t@IContextMenuService private readonly _contextMenuService: IContextMenuService,\n\t) {\n\t\tsuper();\n\t\tthis._originalTopPadding = observableValue(this, 0);\n\t\tthis._originalScrollOffset = observableValue<number, boolean>(this, 0);\n\t\tthis._originalScrollOffsetAnimated = animatedObservable(this._targetWindow, this._originalScrollOffset, this._store);\n\t\tthis._modifiedTopPadding = observableValue(this, 0);\n\t\tthis._modifiedScrollOffset = observableValue<number, boolean>(this, 0);\n\t\tthis._modifiedScrollOffsetAnimated = animatedObservable(this._targetWindow, this._modifiedScrollOffset, this._store);\n\n\t\tconst state = observableValue('invalidateAlignmentsState', 0);\n\n\t\tconst updateImmediately = this._register(new RunOnceScheduler(() => {\n\t\t\tstate.set(state.get() + 1, undefined);\n\t\t}, 0));\n\n\t\tthis._register(this._editors.original.onDidChangeViewZones((_args) => { if (!this._canIgnoreViewZoneUpdateEvent()) { updateImmediately.schedule(); } }));\n\t\tthis._register(this._editors.modified.onDidChangeViewZones((_args) => { if (!this._canIgnoreViewZoneUpdateEvent()) { updateImmediately.schedule(); } }));\n\t\tthis._register(this._editors.original.onDidChangeConfiguration((args) => {\n\t\t\tif (args.hasChanged(EditorOption.wrappingInfo) || args.hasChanged(EditorOption.lineHeight)) { updateImmediately.schedule(); }\n\t\t}));\n\t\tthis._register(this._editors.modified.onDidChangeConfiguration((args) => {\n\t\t\tif (args.hasChanged(EditorOption.wrappingInfo) || args.hasChanged(EditorOption.lineHeight)) { updateImmediately.schedule(); }\n\t\t}));\n\n\t\tconst originalModelTokenizationCompleted = this._diffModel.map(m =>\n\t\t\tm ? observableFromEvent(this, m.model.original.onDidChangeTokens, () => m.model.original.tokenization.backgroundTokenizationState === BackgroundTokenizationState.Completed) : undefined\n\t\t).map((m, reader) => m?.read(reader));\n\n\t\tconst alignments = derived<ILineRangeAlignment[] | null>((reader) => {\n\t\t\t/** @description alignments */\n\t\t\tconst diffModel = this._diffModel.read(reader);\n\t\t\tconst diff = diffModel?.diff.read(reader);\n\t\t\tif (!diffModel || !diff) { return null; }\n\t\t\tstate.read(reader);\n\t\t\tconst renderSideBySide = this._options.renderSideBySide.read(reader);\n\t\t\tconst innerHunkAlignment = renderSideBySide;\n\t\t\treturn computeRangeAlignment(\n\t\t\t\tthis._editors.original,\n\t\t\t\tthis._editors.modified,\n\t\t\t\tdiff.mappings,\n\t\t\t\tthis._origViewZonesToIgnore,\n\t\t\t\tthis._modViewZonesToIgnore,\n\t\t\t\tinnerHunkAlignment\n\t\t\t);\n\t\t});\n\n\t\tconst alignmentsSyncedMovedText = derived<ILineRangeAlignment[] | null>((reader) => {\n\t\t\t/** @description alignmentsSyncedMovedText */\n\t\t\tconst syncedMovedText = this._diffModel.read(reader)?.movedTextToCompare.read(reader);\n\t\t\tif (!syncedMovedText) { return null; }\n\t\t\tstate.read(reader);\n\t\t\tconst mappings = syncedMovedText.changes.map(c => new DiffMapping(c));\n\t\t\t// TODO dont include alignments outside syncedMovedText\n\t\t\treturn computeRangeAlignment(\n\t\t\t\tthis._editors.original,\n\t\t\t\tthis._editors.modified,\n\t\t\t\tmappings,\n\t\t\t\tthis._origViewZonesToIgnore,\n\t\t\t\tthis._modViewZonesToIgnore,\n\t\t\t\ttrue\n\t\t\t);\n\t\t});\n\n\t\tfunction createFakeLinesDiv(): HTMLElement {\n\t\t\tconst r = document.createElement('div');\n\t\t\tr.className = 'diagonal-fill';\n\t\t\treturn r;\n\t\t}\n\n\t\tconst alignmentViewZonesDisposables = this._register(new DisposableStore());\n\t\tthis.viewZones = derived<{ orig: IObservableViewZone[]; mod: IObservableViewZone[] }>(this, (reader) => {\n\t\t\talignmentViewZonesDisposables.clear();\n\n\t\t\tconst alignmentsVal = alignments.read(reader) || [];\n\n\t\t\tconst origViewZones: IObservableViewZone[] = [];\n\t\t\tconst modViewZones: IObservableViewZone[] = [];\n\n\t\t\tconst modifiedTopPaddingVal = this._modifiedTopPadding.read(reader);\n\t\t\tif (modifiedTopPaddingVal > 0) {\n\t\t\t\tmodViewZones.push({\n\t\t\t\t\tafterLineNumber: 0,\n\t\t\t\t\tdomNode: document.createElement('div'),\n\t\t\t\t\theightInPx: modifiedTopPaddingVal,\n\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst originalTopPaddingVal = this._originalTopPadding.read(reader);\n\t\t\tif (originalTopPaddingVal > 0) {\n\t\t\t\torigViewZones.push({\n\t\t\t\t\tafterLineNumber: 0,\n\t\t\t\t\tdomNode: document.createElement('div'),\n\t\t\t\t\theightInPx: originalTopPaddingVal,\n\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst renderSideBySide = this._options.renderSideBySide.read(reader);\n\n\t\t\tconst deletedCodeLineBreaksComputer = !renderSideBySide ? this._editors.modified._getViewModel()?.createLineBreaksComputer() : undefined;\n\t\t\tif (deletedCodeLineBreaksComputer) {\n\t\t\t\tconst originalModel = this._editors.original.getModel()!;\n\t\t\t\tfor (const a of alignmentsVal) {\n\t\t\t\t\tif (a.diff) {\n\t\t\t\t\t\tfor (let i = a.originalRange.startLineNumber; i < a.originalRange.endLineNumberExclusive; i++) {\n\t\t\t\t\t\t\t// `i` can be out of bound when the diff has not been updated yet.\n\t\t\t\t\t\t\t// In this case, we do an early return.\n\t\t\t\t\t\t\t// TODO@hediet: Fix this by applying the edit directly to the diff model, so that the diff is always valid.\n\t\t\t\t\t\t\tif (i > originalModel.getLineCount()) {\n\t\t\t\t\t\t\t\treturn { orig: origViewZones, mod: modViewZones };\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdeletedCodeLineBreaksComputer?.addRequest(originalModel.getLineContent(i), null, null);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst lineBreakData = deletedCodeLineBreaksComputer?.finalize() ?? [];\n\t\t\tlet lineBreakDataIdx = 0;\n\n\t\t\tconst modLineHeight = this._editors.modified.getOption(EditorOption.lineHeight);\n\n\t\t\tconst syncedMovedText = this._diffModel.read(reader)?.movedTextToCompare.read(reader);\n\n\t\t\tconst mightContainNonBasicASCII = this._editors.original.getModel()?.mightContainNonBasicASCII() ?? false;\n\t\t\tconst mightContainRTL = this._editors.original.getModel()?.mightContainRTL() ?? false;\n\t\t\tconst renderOptions = RenderOptions.fromEditor(this._editors.modified);\n\n\t\t\tfor (const a of alignmentsVal) {\n\t\t\t\tif (a.diff && !renderSideBySide && (!this._options.useTrueInlineDiffRendering.read(reader) || !allowsTrueInlineDiffRendering(a.diff))) {\n\t\t\t\t\tif (!a.originalRange.isEmpty) {\n\t\t\t\t\t\toriginalModelTokenizationCompleted.read(reader); // Update view-zones once tokenization completes\n\n\t\t\t\t\t\tconst deletedCodeDomNode = document.createElement('div');\n\t\t\t\t\t\tdeletedCodeDomNode.classList.add('view-lines', 'line-delete', 'monaco-mouse-cursor-text');\n\t\t\t\t\t\tconst originalModel = this._editors.original.getModel()!;\n\t\t\t\t\t\t// `a.originalRange` can be out of bound when the diff has not been updated yet.\n\t\t\t\t\t\t// In this case, we do an early return.\n\t\t\t\t\t\t// TODO@hediet: Fix this by applying the edit directly to the diff model, so that the diff is always valid.\n\t\t\t\t\t\tif (a.originalRange.endLineNumberExclusive - 1 > originalModel.getLineCount()) {\n\t\t\t\t\t\t\treturn { orig: origViewZones, mod: modViewZones };\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst source = new LineSource(\n\t\t\t\t\t\t\ta.originalRange.mapToLineArray(l => originalModel.tokenization.getLineTokens(l)),\n\t\t\t\t\t\t\ta.originalRange.mapToLineArray(_ => lineBreakData[lineBreakDataIdx++]),\n\t\t\t\t\t\t\tmightContainNonBasicASCII,\n\t\t\t\t\t\t\tmightContainRTL,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst decorations: InlineDecoration[] = [];\n\t\t\t\t\t\tfor (const i of a.diff.innerChanges || []) {\n\t\t\t\t\t\t\tdecorations.push(new InlineDecoration(\n\t\t\t\t\t\t\t\ti.originalRange.delta(-(a.diff.original.startLineNumber - 1)),\n\t\t\t\t\t\t\t\tdiffDeleteDecoration.className!,\n\t\t\t\t\t\t\t\tInlineDecorationType.Regular\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst result = renderLines(source, renderOptions, decorations, deletedCodeDomNode);\n\n\t\t\t\t\t\tconst marginDomNode = document.createElement('div');\n\t\t\t\t\t\tmarginDomNode.className = 'inline-deleted-margin-view-zone';\n\t\t\t\t\t\tapplyFontInfo(marginDomNode, renderOptions.fontInfo);\n\n\t\t\t\t\t\tif (this._options.renderIndicators.read(reader)) {\n\t\t\t\t\t\t\tfor (let i = 0; i < result.heightInLines; i++) {\n\t\t\t\t\t\t\t\tconst marginElement = document.createElement('div');\n\t\t\t\t\t\t\t\tmarginElement.className = `delete-sign ${ThemeIcon.asClassName(diffRemoveIcon)}`;\n\t\t\t\t\t\t\t\tmarginElement.setAttribute('style', `position:absolute;top:${i * modLineHeight}px;width:${renderOptions.lineDecorationsWidth}px;height:${modLineHeight}px;right:0;`);\n\t\t\t\t\t\t\t\tmarginDomNode.appendChild(marginElement);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet zoneId: string | undefined = undefined;\n\t\t\t\t\t\talignmentViewZonesDisposables.add(\n\t\t\t\t\t\t\tnew InlineDiffDeletedCodeMargin(\n\t\t\t\t\t\t\t\t() => assertReturnsDefined(zoneId),\n\t\t\t\t\t\t\t\tmarginDomNode,\n\t\t\t\t\t\t\t\tthis._editors.modified,\n\t\t\t\t\t\t\t\ta.diff,\n\t\t\t\t\t\t\t\tthis._diffEditorWidget,\n\t\t\t\t\t\t\t\tresult.viewLineCounts,\n\t\t\t\t\t\t\t\tthis._editors.original.getModel()!,\n\t\t\t\t\t\t\t\tthis._contextMenuService,\n\t\t\t\t\t\t\t\tthis._clipboardService,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tfor (let i = 0; i < result.viewLineCounts.length; i++) {\n\t\t\t\t\t\t\tconst count = result.viewLineCounts[i];\n\t\t\t\t\t\t\t// Account for wrapped lines in the (collapsed) original editor (which doesn't wrap lines).\n\t\t\t\t\t\t\tif (count > 1) {\n\t\t\t\t\t\t\t\torigViewZones.push({\n\t\t\t\t\t\t\t\t\tafterLineNumber: a.originalRange.startLineNumber + i,\n\t\t\t\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\t\t\t\theightInPx: (count - 1) * modLineHeight,\n\t\t\t\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmodViewZones.push({\n\t\t\t\t\t\t\tafterLineNumber: a.modifiedRange.startLineNumber - 1,\n\t\t\t\t\t\t\tdomNode: deletedCodeDomNode,\n\t\t\t\t\t\t\theightInPx: result.heightInLines * modLineHeight,\n\t\t\t\t\t\t\tminWidthInPx: result.minWidthInPx,\n\t\t\t\t\t\t\tmarginDomNode,\n\t\t\t\t\t\t\tsetZoneId(id) { zoneId = id; },\n\t\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tconst marginDomNode = document.createElement('div');\n\t\t\t\t\tmarginDomNode.className = 'gutter-delete';\n\n\t\t\t\t\torigViewZones.push({\n\t\t\t\t\t\tafterLineNumber: a.originalRange.endLineNumberExclusive - 1,\n\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\theightInPx: a.modifiedHeightInPx,\n\t\t\t\t\t\tmarginDomNode,\n\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tconst delta = a.modifiedHeightInPx - a.originalHeightInPx;\n\t\t\t\t\tif (delta > 0) {\n\t\t\t\t\t\tif (syncedMovedText?.lineRangeMapping.original.delta(-1).deltaLength(2).contains(a.originalRange.endLineNumberExclusive - 1)) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\torigViewZones.push({\n\t\t\t\t\t\t\tafterLineNumber: a.originalRange.endLineNumberExclusive - 1,\n\t\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\t\theightInPx: delta,\n\t\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (syncedMovedText?.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(a.modifiedRange.endLineNumberExclusive - 1)) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction createViewZoneMarginArrow(): HTMLElement {\n\t\t\t\t\t\t\tconst arrow = document.createElement('div');\n\t\t\t\t\t\t\tarrow.className = 'arrow-revert-change ' + ThemeIcon.asClassName(Codicon.arrowRight);\n\t\t\t\t\t\t\treader.store.add(addDisposableListener(arrow, 'mousedown', e => e.stopPropagation()));\n\t\t\t\t\t\t\treader.store.add(addDisposableListener(arrow, 'click', e => {\n\t\t\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\t\t\t_diffEditorWidget.revert(a.diff!);\n\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t\treturn $('div', {}, arrow);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet marginDomNode: HTMLElement | undefined = undefined;\n\t\t\t\t\t\tif (a.diff && a.diff.modified.isEmpty && this._options.shouldRenderOldRevertArrows.read(reader)) {\n\t\t\t\t\t\t\tmarginDomNode = createViewZoneMarginArrow();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmodViewZones.push({\n\t\t\t\t\t\t\tafterLineNumber: a.modifiedRange.endLineNumberExclusive - 1,\n\t\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\t\theightInPx: -delta,\n\t\t\t\t\t\t\tmarginDomNode,\n\t\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (const a of alignmentsSyncedMovedText.read(reader) ?? []) {\n\t\t\t\tif (!syncedMovedText?.lineRangeMapping.original.intersect(a.originalRange)\n\t\t\t\t\t|| !syncedMovedText?.lineRangeMapping.modified.intersect(a.modifiedRange)) {\n\t\t\t\t\t// ignore unrelated alignments outside the synced moved text\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst delta = a.modifiedHeightInPx - a.originalHeightInPx;\n\t\t\t\tif (delta > 0) {\n\t\t\t\t\torigViewZones.push({\n\t\t\t\t\t\tafterLineNumber: a.originalRange.endLineNumberExclusive - 1,\n\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\theightInPx: delta,\n\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tmodViewZones.push({\n\t\t\t\t\t\tafterLineNumber: a.modifiedRange.endLineNumberExclusive - 1,\n\t\t\t\t\t\tdomNode: createFakeLinesDiv(),\n\t\t\t\t\t\theightInPx: -delta,\n\t\t\t\t\t\tshowInHiddenAreas: true,\n\t\t\t\t\t\tsuppressMouseDown: true,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn { orig: origViewZones, mod: modViewZones };\n\t\t});\n\n\t\tlet ignoreChange = false;\n\t\tthis._register(this._editors.original.onDidScrollChange(e => {\n\t\t\tif (e.scrollLeftChanged && !ignoreChange) {\n\t\t\t\tignoreChange = true;\n\t\t\t\tthis._editors.modified.setScrollLeft(e.scrollLeft);\n\t\t\t\tignoreChange = false;\n\t\t\t}\n\t\t}));\n\t\tthis._register(this._editors.modified.onDidScrollChange(e => {\n\t\t\tif (e.scrollLeftChanged && !ignoreChange) {\n\t\t\t\tignoreChange = true;\n\t\t\t\tthis._editors.original.setScrollLeft(e.scrollLeft);\n\t\t\t\tignoreChange = false;\n\t\t\t}\n\t\t}));\n\n\t\tthis._originalScrollTop = observableFromEvent(this._editors.original.onDidScrollChange, () => /** @description original.getScrollTop */ this._editors.original.getScrollTop());\n\t\tthis._modifiedScrollTop = observableFromEvent(this._editors.modified.onDidScrollChange, () => /** @description modified.getScrollTop */ this._editors.modified.getScrollTop());\n\n\t\t// origExtraHeight + origOffset - origScrollTop = modExtraHeight + modOffset - modScrollTop\n\n\t\t// origScrollTop = origExtraHeight + origOffset - modExtraHeight - modOffset + modScrollTop\n\t\t// modScrollTop = modExtraHeight + modOffset - origExtraHeight - origOffset + origScrollTop\n\n\t\t// origOffset - modOffset = heightOfLines(1..Y) - heightOfLines(1..X)\n\t\t// origScrollTop >= 0, modScrollTop >= 0\n\n\t\tthis._register(autorun(reader => {\n\t\t\t/** @description update scroll modified */\n\t\t\tconst newScrollTopModified = this._originalScrollTop.read(reader)\n\t\t\t\t- (this._originalScrollOffsetAnimated.read(undefined) - this._modifiedScrollOffsetAnimated.read(reader))\n\t\t\t\t- (this._originalTopPadding.read(undefined) - this._modifiedTopPadding.read(reader));\n\t\t\tif (newScrollTopModified !== this._editors.modified.getScrollTop()) {\n\t\t\t\tthis._editors.modified.setScrollTop(newScrollTopModified, ScrollType.Immediate);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(autorun(reader => {\n\t\t\t/** @description update scroll original */\n\t\t\tconst newScrollTopOriginal = this._modifiedScrollTop.read(reader)\n\t\t\t\t- (this._modifiedScrollOffsetAnimated.read(undefined) - this._originalScrollOffsetAnimated.read(reader))\n\t\t\t\t- (this._modifiedTopPadding.read(undefined) - this._originalTopPadding.read(reader));\n\t\t\tif (newScrollTopOriginal !== this._editors.original.getScrollTop()) {\n\t\t\t\tthis._editors.original.setScrollTop(newScrollTopOriginal, ScrollType.Immediate);\n\t\t\t}\n\t\t}));\n\n\n\t\tthis._register(autorun(reader => {\n\t\t\t/** @description update editor top offsets */\n\t\t\tconst m = this._diffModel.read(reader)?.movedTextToCompare.read(reader);\n\n\t\t\tlet deltaOrigToMod = 0;\n\t\t\tif (m) {\n\t\t\t\tconst trueTopOriginal = this._editors.original.getTopForLineNumber(m.lineRangeMapping.original.startLineNumber, true) - this._originalTopPadding.read(undefined);\n\t\t\t\tconst trueTopModified = this._editors.modified.getTopForLineNumber(m.lineRangeMapping.modified.startLineNumber, true) - this._modifiedTopPadding.read(undefined);\n\t\t\t\tdeltaOrigToMod = trueTopModified - trueTopOriginal;\n\t\t\t}\n\n\t\t\tif (deltaOrigToMod > 0) {\n\t\t\t\tthis._modifiedTopPadding.set(0, undefined);\n\t\t\t\tthis._originalTopPadding.set(deltaOrigToMod, undefined);\n\t\t\t} else if (deltaOrigToMod < 0) {\n\t\t\t\tthis._modifiedTopPadding.set(-deltaOrigToMod, undefined);\n\t\t\t\tthis._originalTopPadding.set(0, undefined);\n\t\t\t} else {\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tthis._modifiedTopPadding.set(0, undefined);\n\t\t\t\t\tthis._originalTopPadding.set(0, undefined);\n\t\t\t\t}, 400);\n\t\t\t}\n\n\t\t\tif (this._editors.modified.hasTextFocus()) {\n\t\t\t\tthis._originalScrollOffset.set(this._modifiedScrollOffset.read(undefined) - deltaOrigToMod, undefined, true);\n\t\t\t} else {\n\t\t\t\tthis._modifiedScrollOffset.set(this._originalScrollOffset.read(undefined) + deltaOrigToMod, undefined, true);\n\t\t\t}\n\t\t}));\n\t}\n}\n\ninterface ILineRangeAlignment {\n\toriginalRange: LineRange;\n\tmodifiedRange: LineRange;\n\n\t// accounts for foreign viewzones and line wrapping\n\toriginalHeightInPx: number;\n\tmodifiedHeightInPx: number;\n\n\t/**\n\t * If this range alignment is a direct result of a diff, then this is the diff's line mapping.\n\t * Only used for inline-view.\n\t */\n\tdiff?: DetailedLineRangeMapping;\n}\n\nfunction computeRangeAlignment(\n\toriginalEditor: CodeEditorWidget,\n\tmodifiedEditor: CodeEditorWidget,\n\tdiffs: readonly DiffMapping[],\n\toriginalEditorAlignmentViewZones: ReadonlySet<string>,\n\tmodifiedEditorAlignmentViewZones: ReadonlySet<string>,\n\tinnerHunkAlignment: boolean,\n): ILineRangeAlignment[] {\n\tconst originalLineHeightOverrides = new ArrayQueue(getAdditionalLineHeights(originalEditor, originalEditorAlignmentViewZones));\n\tconst modifiedLineHeightOverrides = new ArrayQueue(getAdditionalLineHeights(modifiedEditor, modifiedEditorAlignmentViewZones));\n\n\tconst origLineHeight = originalEditor.getOption(EditorOption.lineHeight);\n\tconst modLineHeight = modifiedEditor.getOption(EditorOption.lineHeight);\n\n\tconst result: ILineRangeAlignment[] = [];\n\n\tlet lastOriginalLineNumber = 0;\n\tlet lastModifiedLineNumber = 0;\n\n\tfunction handleAlignmentsOutsideOfDiffs(untilOriginalLineNumberExclusive: number, untilModifiedLineNumberExclusive: number) {\n\t\twhile (true) {\n\t\t\tlet origNext = originalLineHeightOverrides.peek();\n\t\t\tlet modNext = modifiedLineHeightOverrides.peek();\n\t\t\tif (origNext && origNext.lineNumber >= untilOriginalLineNumberExclusive) {\n\t\t\t\torigNext = undefined;\n\t\t\t}\n\t\t\tif (modNext && modNext.lineNumber >= untilModifiedLineNumberExclusive) {\n\t\t\t\tmodNext = undefined;\n\t\t\t}\n\t\t\tif (!origNext && !modNext) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst distOrig = origNext ? origNext.lineNumber - lastOriginalLineNumber : Number.MAX_VALUE;\n\t\t\tconst distNext = modNext ? modNext.lineNumber - lastModifiedLineNumber : Number.MAX_VALUE;\n\n\t\t\tif (distOrig < distNext) {\n\t\t\t\toriginalLineHeightOverrides.dequeue();\n\t\t\t\tmodNext = {\n\t\t\t\t\tlineNumber: origNext!.lineNumber - lastOriginalLineNumber + lastModifiedLineNumber,\n\t\t\t\t\theightInPx: 0,\n\t\t\t\t};\n\t\t\t} else if (distOrig > distNext) {\n\t\t\t\tmodifiedLineHeightOverrides.dequeue();\n\t\t\t\torigNext = {\n\t\t\t\t\tlineNumber: modNext!.lineNumber - lastModifiedLineNumber + lastOriginalLineNumber,\n\t\t\t\t\theightInPx: 0,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\toriginalLineHeightOverrides.dequeue();\n\t\t\t\tmodifiedLineHeightOverrides.dequeue();\n\t\t\t}\n\n\t\t\tresult.push({\n\t\t\t\toriginalRange: LineRange.ofLength(origNext!.lineNumber, 1),\n\t\t\t\tmodifiedRange: LineRange.ofLength(modNext!.lineNumber, 1),\n\t\t\t\toriginalHeightInPx: origLineHeight + origNext!.heightInPx,\n\t\t\t\tmodifiedHeightInPx: modLineHeight + modNext!.heightInPx,\n\t\t\t\tdiff: undefined,\n\t\t\t});\n\t\t}\n\t}\n\n\tfor (const m of diffs) {\n\t\tconst c = m.lineRangeMapping;\n\t\thandleAlignmentsOutsideOfDiffs(c.original.startLineNumber, c.modified.startLineNumber);\n\n\t\tlet first = true;\n\t\tlet lastModLineNumber = c.modified.startLineNumber;\n\t\tlet lastOrigLineNumber = c.original.startLineNumber;\n\n\t\tfunction emitAlignment(origLineNumberExclusive: number, modLineNumberExclusive: number, forceAlignment = false) {\n\t\t\tif (origLineNumberExclusive < lastOrigLineNumber || modLineNumberExclusive < lastModLineNumber) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (first) {\n\t\t\t\tfirst = false;\n\t\t\t} else if (!forceAlignment && (origLineNumberExclusive === lastOrigLineNumber || modLineNumberExclusive === lastModLineNumber)) {\n\t\t\t\t// This causes a re-alignment of an already aligned line.\n\t\t\t\t// However, we don't care for the final alignment.\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst originalRange = new LineRange(lastOrigLineNumber, origLineNumberExclusive);\n\t\t\tconst modifiedRange = new LineRange(lastModLineNumber, modLineNumberExclusive);\n\t\t\tif (originalRange.isEmpty && modifiedRange.isEmpty) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst originalAdditionalHeight = originalLineHeightOverrides\n\t\t\t\t.takeWhile(v => v.lineNumber < origLineNumberExclusive)\n\t\t\t\t?.reduce((p, c) => p + c.heightInPx, 0) ?? 0;\n\t\t\tconst modifiedAdditionalHeight = modifiedLineHeightOverrides\n\t\t\t\t.takeWhile(v => v.lineNumber < modLineNumberExclusive)\n\t\t\t\t?.reduce((p, c) => p + c.heightInPx, 0) ?? 0;\n\n\t\t\tresult.push({\n\t\t\t\toriginalRange,\n\t\t\t\tmodifiedRange,\n\t\t\t\toriginalHeightInPx: originalRange.length * origLineHeight + originalAdditionalHeight,\n\t\t\t\tmodifiedHeightInPx: modifiedRange.length * modLineHeight + modifiedAdditionalHeight,\n\t\t\t\tdiff: m.lineRangeMapping,\n\t\t\t});\n\n\t\t\tlastOrigLineNumber = origLineNumberExclusive;\n\t\t\tlastModLineNumber = modLineNumberExclusive;\n\t\t}\n\n\t\tif (innerHunkAlignment) {\n\t\t\tfor (const i of c.innerChanges || []) {\n\t\t\t\tif (i.originalRange.startColumn > 1 && i.modifiedRange.startColumn > 1) {\n\t\t\t\t\t// There is some unmodified text on this line before the diff\n\t\t\t\t\temitAlignment(i.originalRange.startLineNumber, i.modifiedRange.startLineNumber);\n\t\t\t\t}\n\t\t\t\tconst originalModel = originalEditor.getModel()!;\n\t\t\t\t// When the diff is invalid, the ranges might be out of bounds (this should be fixed in the diff model by applying edits directly).\n\t\t\t\tconst maxColumn = i.originalRange.endLineNumber <= originalModel.getLineCount() ? originalModel.getLineMaxColumn(i.originalRange.endLineNumber) : Number.MAX_SAFE_INTEGER;\n\t\t\t\tif (i.originalRange.endColumn < maxColumn) {\n\t\t\t\t\t// // There is some unmodified text on this line after the diff\n\t\t\t\t\temitAlignment(i.originalRange.endLineNumber, i.modifiedRange.endLineNumber);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\temitAlignment(c.original.endLineNumberExclusive, c.modified.endLineNumberExclusive, true);\n\n\t\tlastOriginalLineNumber = c.original.endLineNumberExclusive;\n\t\tlastModifiedLineNumber = c.modified.endLineNumberExclusive;\n\t}\n\thandleAlignmentsOutsideOfDiffs(Number.MAX_VALUE, Number.MAX_VALUE);\n\n\treturn result;\n}\n\ninterface AdditionalLineHeightInfo {\n\tlineNumber: number;\n\theightInPx: number;\n}\n\nfunction getAdditionalLineHeights(editor: CodeEditorWidget, viewZonesToIgnore: ReadonlySet<string>): readonly AdditionalLineHeightInfo[] {\n\tconst viewZoneHeights: { lineNumber: number; heightInPx: number }[] = [];\n\tconst wrappingZoneHeights: { lineNumber: number; heightInPx: number }[] = [];\n\n\tconst hasWrapping = editor.getOption(EditorOption.wrappingInfo).wrappingColumn !== -1;\n\tconst coordinatesConverter = editor._getViewModel()!.coordinatesConverter;\n\tconst editorLineHeight = editor.getOption(EditorOption.lineHeight);\n\tif (hasWrapping) {\n\t\tfor (let i = 1; i <= editor.getModel()!.getLineCount(); i++) {\n\t\t\tconst lineCount = coordinatesConverter.getModelLineViewLineCount(i);\n\t\t\tif (lineCount > 1) {\n\t\t\t\twrappingZoneHeights.push({ lineNumber: i, heightInPx: editorLineHeight * (lineCount - 1) });\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (const w of editor.getWhitespaces()) {\n\t\tif (viewZonesToIgnore.has(w.id)) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst modelLineNumber = w.afterLineNumber === 0 ? 0 : coordinatesConverter.convertViewPositionToModelPosition(\n\t\t\tnew Position(w.afterLineNumber, 1)\n\t\t).lineNumber;\n\t\tviewZoneHeights.push({ lineNumber: modelLineNumber, heightInPx: w.height });\n\t}\n\n\tconst result = joinCombine(\n\t\tviewZoneHeights,\n\t\twrappingZoneHeights,\n\t\tv => v.lineNumber,\n\t\t(v1, v2) => ({ lineNumber: v1.lineNumber, heightInPx: v1.heightInPx + v2.heightInPx })\n\t);\n\n\treturn result;\n}\n\nexport function allowsTrueInlineDiffRendering(mapping: DetailedLineRangeMapping): boolean {\n\tif (!mapping.innerChanges) {\n\t\treturn false;\n\t}\n\treturn mapping.innerChanges.every(c =>\n\t\t(rangeIsSingleLine(c.modifiedRange) && rangeIsSingleLine(c.originalRange))\n\t\t|| c.originalRange.equalsRange(new Range(1, 1, 1, 1))\n\t);\n}\n\nexport function rangeIsSingleLine(range: Range): boolean {\n\treturn range.startLineNumber === range.endLineNumber;\n}\n"]}
|
|
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,O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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"]}
|
|
@@ -9,6 +9,7 @@ import { Disposable } from '../../../../../../base/common/lifecycle.js';
|
|
|
9
9
|
import { isIOS } from '../../../../../../base/common/platform.js';
|
|
10
10
|
import { ThemeIcon } from '../../../../../../base/common/themables.js';
|
|
11
11
|
import { localize } from '../../../../../../nls.js';
|
|
12
|
+
import { enableCopySelection } from './copySelection.js';
|
|
12
13
|
export class InlineDiffDeletedCodeMargin extends Disposable {
|
|
13
14
|
get visibility() {
|
|
14
15
|
return this._visibility;
|
|
@@ -19,10 +20,11 @@ export class InlineDiffDeletedCodeMargin extends Disposable {
|
|
|
19
20
|
this._diffActions.style.visibility = _visibility ? 'visible' : 'hidden';
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
|
-
constructor(_getViewZoneId, _marginDomNode, _modifiedEditor, _diff, _editor, _viewLineCounts, _originalTextModel, _contextMenuService, _clipboardService) {
|
|
23
|
+
constructor(_getViewZoneId, _marginDomNode, _deletedCodeDomNode, _modifiedEditor, _diff, _editor, _viewLineCounts, _originalTextModel, _contextMenuService, _clipboardService) {
|
|
23
24
|
super();
|
|
24
25
|
this._getViewZoneId = _getViewZoneId;
|
|
25
26
|
this._marginDomNode = _marginDomNode;
|
|
27
|
+
this._deletedCodeDomNode = _deletedCodeDomNode;
|
|
26
28
|
this._modifiedEditor = _modifiedEditor;
|
|
27
29
|
this._diff = _diff;
|
|
28
30
|
this._editor = _editor;
|
|
@@ -44,28 +46,29 @@ export class InlineDiffDeletedCodeMargin extends Disposable {
|
|
|
44
46
|
this._marginDomNode.appendChild(this._diffActions);
|
|
45
47
|
let currentLineNumberOffset = 0;
|
|
46
48
|
const useShadowDOM = _modifiedEditor.getOption(144 /* EditorOption.useShadowDOM */) && !isIOS; // Do not use shadow dom on IOS #122035
|
|
47
|
-
const showContextMenu = (
|
|
49
|
+
const showContextMenu = (anchor, baseActions, onHide) => {
|
|
48
50
|
this._contextMenuService.showContextMenu({
|
|
49
51
|
domForShadowRoot: useShadowDOM ? _modifiedEditor.getDomNode() ?? undefined : undefined,
|
|
50
|
-
getAnchor: () =>
|
|
52
|
+
getAnchor: () => anchor,
|
|
53
|
+
onHide,
|
|
51
54
|
getActions: () => {
|
|
52
|
-
const actions = [];
|
|
55
|
+
const actions = baseActions ?? [];
|
|
53
56
|
const isDeletion = _diff.modified.isEmpty;
|
|
54
57
|
// default action
|
|
55
58
|
actions.push(new Action('diff.clipboard.copyDeletedContent', isDeletion
|
|
56
59
|
? (_diff.original.length > 1
|
|
57
|
-
? localize(
|
|
58
|
-
: localize(
|
|
60
|
+
? localize(110, "Copy deleted lines")
|
|
61
|
+
: localize(111, "Copy deleted line"))
|
|
59
62
|
: (_diff.original.length > 1
|
|
60
|
-
? localize(
|
|
61
|
-
: localize(
|
|
63
|
+
? localize(112, "Copy changed lines")
|
|
64
|
+
: localize(113, "Copy changed line")), undefined, true, async () => {
|
|
62
65
|
const originalText = this._originalTextModel.getValueInRange(_diff.original.toExclusiveRange());
|
|
63
66
|
await this._clipboardService.writeText(originalText);
|
|
64
67
|
}));
|
|
65
68
|
if (_diff.original.length > 1) {
|
|
66
69
|
actions.push(new Action('diff.clipboard.copyDeletedLineContent', isDeletion
|
|
67
|
-
? localize(
|
|
68
|
-
: localize(
|
|
70
|
+
? localize(114, "Copy deleted line ({0})", _diff.original.startLineNumber + currentLineNumberOffset)
|
|
71
|
+
: localize(115, "Copy changed line ({0})", _diff.original.startLineNumber + currentLineNumberOffset), undefined, true, async () => {
|
|
69
72
|
let lineContent = this._originalTextModel.getLineContent(_diff.original.startLineNumber + currentLineNumberOffset);
|
|
70
73
|
if (lineContent === '') {
|
|
71
74
|
// empty line -> new line
|
|
@@ -77,7 +80,7 @@ export class InlineDiffDeletedCodeMargin extends Disposable {
|
|
|
77
80
|
}
|
|
78
81
|
const readOnly = _modifiedEditor.getOption(104 /* EditorOption.readOnly */);
|
|
79
82
|
if (!readOnly) {
|
|
80
|
-
actions.push(new Action('diff.inline.revertChange', localize(
|
|
83
|
+
actions.push(new Action('diff.inline.revertChange', localize(116, "Revert this change"), undefined, true, async () => {
|
|
81
84
|
this._editor.revert(this._diff);
|
|
82
85
|
}));
|
|
83
86
|
}
|
|
@@ -93,7 +96,7 @@ export class InlineDiffDeletedCodeMargin extends Disposable {
|
|
|
93
96
|
const { top, height } = getDomNodePagePosition(this._diffActions);
|
|
94
97
|
const pad = Math.floor(lineHeight / 3);
|
|
95
98
|
e.preventDefault();
|
|
96
|
-
showContextMenu(e.posx, top + height + pad);
|
|
99
|
+
showContextMenu({ x: e.posx, y: top + height + pad });
|
|
97
100
|
}));
|
|
98
101
|
this._register(_modifiedEditor.onMouseMove((e) => {
|
|
99
102
|
if ((e.target.type === 8 /* MouseTargetType.CONTENT_VIEW_ZONE */ || e.target.type === 5 /* MouseTargetType.GUTTER_VIEW_ZONE */) && e.target.detail.viewZoneId === this._getViewZoneId()) {
|
|
@@ -104,18 +107,16 @@ export class InlineDiffDeletedCodeMargin extends Disposable {
|
|
|
104
107
|
this.visibility = false;
|
|
105
108
|
}
|
|
106
109
|
}));
|
|
107
|
-
this._register(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
}
|
|
110
|
+
this._register(enableCopySelection({
|
|
111
|
+
domNode: this._deletedCodeDomNode,
|
|
112
|
+
getViewZoneId: () => this._getViewZoneId(),
|
|
113
|
+
diffEntry: _diff,
|
|
114
|
+
originalModel: this._originalTextModel,
|
|
115
|
+
editorLineHeight: lineHeight,
|
|
116
|
+
viewLineCounts: this._viewLineCounts,
|
|
117
|
+
editor: _modifiedEditor,
|
|
118
|
+
showContextMenu,
|
|
119
|
+
clipboardService: _clipboardService,
|
|
119
120
|
}));
|
|
120
121
|
}
|
|
121
122
|
_updateLightBulbPosition(marginDomNode, y, lineHeight) {
|
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zB,CAAC;CACD","file":"inlineDiffDeletedCodeMargin.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 { addStandardDisposableListener, getDomNodePagePosition } from '../../../../../../base/browser/dom.js';\nimport { Action } from '../../../../../../base/common/actions.js';\nimport { Codicon } from '../../../../../../base/common/codicons.js';\nimport { Disposable } from '../../../../../../base/common/lifecycle.js';\nimport { isIOS } from '../../../../../../base/common/platform.js';\nimport { ThemeIcon } from '../../../../../../base/common/themables.js';\nimport { IEditorMouseEvent, MouseTargetType } from '../../../../editorBrowser.js';\nimport { CodeEditorWidget } from '../../../codeEditor/codeEditorWidget.js';\nimport { DiffEditorWidget } from '../../diffEditorWidget.js';\nimport { EditorOption } from '../../../../../common/config/editorOptions.js';\nimport { DetailedLineRangeMapping } from '../../../../../common/diff/rangeMapping.js';\nimport { EndOfLineSequence, ITextModel } from '../../../../../common/model.js';\nimport { localize } from '../../../../../../nls.js';\nimport { IClipboardService } from '../../../../../../platform/clipboard/common/clipboardService.js';\nimport { IContextMenuService } from '../../../../../../platform/contextview/browser/contextView.js';\n\nexport class InlineDiffDeletedCodeMargin extends Disposable {\n\tprivate readonly _diffActions: HTMLElement;\n\n\tprivate _visibility: boolean = false;\n\n\tget visibility(): boolean {\n\t\treturn this._visibility;\n\t}\n\n\tset visibility(_visibility: boolean) {\n\t\tif (this._visibility !== _visibility) {\n\t\t\tthis._visibility = _visibility;\n\t\t\tthis._diffActions.style.visibility = _visibility ? 'visible' : 'hidden';\n\t\t}\n\t}\n\n\tconstructor(\n\t\tprivate readonly _getViewZoneId: () => string,\n\t\tprivate readonly _marginDomNode: HTMLElement,\n\t\tprivate readonly _modifiedEditor: CodeEditorWidget,\n\t\tprivate readonly _diff: DetailedLineRangeMapping,\n\t\tprivate readonly _editor: DiffEditorWidget,\n\t\tprivate readonly _viewLineCounts: number[],\n\t\tprivate readonly _originalTextModel: ITextModel,\n\t\tprivate readonly _contextMenuService: IContextMenuService,\n\t\tprivate readonly _clipboardService: IClipboardService,\n\t) {\n\t\tsuper();\n\n\t\t// make sure the diff margin shows above overlay.\n\t\tthis._marginDomNode.style.zIndex = '10';\n\n\t\tthis._diffActions = document.createElement('div');\n\t\tthis._diffActions.className = ThemeIcon.asClassName(Codicon.lightBulb) + ' lightbulb-glyph';\n\t\tthis._diffActions.style.position = 'absolute';\n\t\tconst lineHeight = this._modifiedEditor.getOption(EditorOption.lineHeight);\n\t\tthis._diffActions.style.right = '0px';\n\t\tthis._diffActions.style.visibility = 'hidden';\n\t\tthis._diffActions.style.height = `${lineHeight}px`;\n\t\tthis._diffActions.style.lineHeight = `${lineHeight}px`;\n\t\tthis._marginDomNode.appendChild(this._diffActions);\n\n\t\tlet currentLineNumberOffset = 0;\n\n\t\tconst useShadowDOM = _modifiedEditor.getOption(EditorOption.useShadowDOM) && !isIOS; // Do not use shadow dom on IOS #122035\n\t\tconst showContextMenu = (x: number, y: number) => {\n\t\t\tthis._contextMenuService.showContextMenu({\n\t\t\t\tdomForShadowRoot: useShadowDOM ? _modifiedEditor.getDomNode() ?? undefined : undefined,\n\t\t\t\tgetAnchor: () => ({ x, y }),\n\t\t\t\tgetActions: () => {\n\t\t\t\t\tconst actions: Action[] = [];\n\t\t\t\t\tconst isDeletion = _diff.modified.isEmpty;\n\n\t\t\t\t\t// default action\n\t\t\t\t\tactions.push(new Action(\n\t\t\t\t\t\t'diff.clipboard.copyDeletedContent',\n\t\t\t\t\t\tisDeletion\n\t\t\t\t\t\t\t? (_diff.original.length > 1\n\t\t\t\t\t\t\t\t? localize('diff.clipboard.copyDeletedLinesContent.label', \"Copy deleted lines\")\n\t\t\t\t\t\t\t\t: localize('diff.clipboard.copyDeletedLinesContent.single.label', \"Copy deleted line\"))\n\t\t\t\t\t\t\t: (_diff.original.length > 1\n\t\t\t\t\t\t\t\t? localize('diff.clipboard.copyChangedLinesContent.label', \"Copy changed lines\")\n\t\t\t\t\t\t\t\t: localize('diff.clipboard.copyChangedLinesContent.single.label', \"Copy changed line\")),\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\ttrue,\n\t\t\t\t\t\tasync () => {\n\t\t\t\t\t\t\tconst originalText = this._originalTextModel.getValueInRange(_diff.original.toExclusiveRange());\n\t\t\t\t\t\t\tawait this._clipboardService.writeText(originalText);\n\t\t\t\t\t\t}\n\t\t\t\t\t));\n\n\t\t\t\t\tif (_diff.original.length > 1) {\n\t\t\t\t\t\tactions.push(new Action(\n\t\t\t\t\t\t\t'diff.clipboard.copyDeletedLineContent',\n\t\t\t\t\t\t\tisDeletion\n\t\t\t\t\t\t\t\t? localize('diff.clipboard.copyDeletedLineContent.label', \"Copy deleted line ({0})\",\n\t\t\t\t\t\t\t\t\t_diff.original.startLineNumber + currentLineNumberOffset)\n\t\t\t\t\t\t\t\t: localize('diff.clipboard.copyChangedLineContent.label', \"Copy changed line ({0})\",\n\t\t\t\t\t\t\t\t\t_diff.original.startLineNumber + currentLineNumberOffset),\n\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\tasync () => {\n\t\t\t\t\t\t\t\tlet lineContent = this._originalTextModel.getLineContent(_diff.original.startLineNumber + currentLineNumberOffset);\n\t\t\t\t\t\t\t\tif (lineContent === '') {\n\t\t\t\t\t\t\t\t\t// empty line -> new line\n\t\t\t\t\t\t\t\t\tconst eof = this._originalTextModel.getEndOfLineSequence();\n\t\t\t\t\t\t\t\t\tlineContent = eof === EndOfLineSequence.LF ? '\\n' : '\\r\\n';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tawait this._clipboardService.writeText(lineContent);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\t\t\t\t\tconst readOnly = _modifiedEditor.getOption(EditorOption.readOnly);\n\t\t\t\t\tif (!readOnly) {\n\t\t\t\t\t\tactions.push(new Action(\n\t\t\t\t\t\t\t'diff.inline.revertChange',\n\t\t\t\t\t\t\tlocalize('diff.inline.revertChange.label', \"Revert this change\"),\n\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\tasync () => {\n\t\t\t\t\t\t\t\tthis._editor.revert(this._diff);\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\treturn actions;\n\t\t\t\t},\n\t\t\t\tautoSelectFirstItem: true\n\t\t\t});\n\t\t};\n\n\t\tthis._register(addStandardDisposableListener(this._diffActions, 'mousedown', e => {\n\t\t\tif (!e.leftButton) { return; }\n\n\t\t\tconst { top, height } = getDomNodePagePosition(this._diffActions);\n\t\t\tconst pad = Math.floor(lineHeight / 3);\n\t\t\te.preventDefault();\n\t\t\tshowContextMenu(e.posx, top + height + pad);\n\t\t}));\n\n\t\tthis._register(_modifiedEditor.onMouseMove((e: IEditorMouseEvent) => {\n\t\t\tif ((e.target.type === MouseTargetType.CONTENT_VIEW_ZONE || e.target.type === MouseTargetType.GUTTER_VIEW_ZONE) && e.target.detail.viewZoneId === this._getViewZoneId()) {\n\t\t\t\tcurrentLineNumberOffset = this._updateLightBulbPosition(this._marginDomNode, e.event.browserEvent.y, lineHeight);\n\t\t\t\tthis.visibility = true;\n\t\t\t} else {\n\t\t\t\tthis.visibility = false;\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(_modifiedEditor.onMouseDown((e: IEditorMouseEvent) => {\n\t\t\tif (!e.event.leftButton) { return; }\n\n\t\t\tif (e.target.type === MouseTargetType.CONTENT_VIEW_ZONE || e.target.type === MouseTargetType.GUTTER_VIEW_ZONE) {\n\t\t\t\tconst viewZoneId = e.target.detail.viewZoneId;\n\n\t\t\t\tif (viewZoneId === this._getViewZoneId()) {\n\t\t\t\t\te.event.preventDefault();\n\t\t\t\t\tcurrentLineNumberOffset = this._updateLightBulbPosition(this._marginDomNode, e.event.browserEvent.y, lineHeight);\n\t\t\t\t\tshowContextMenu(e.event.posx, e.event.posy + lineHeight);\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\t}\n\n\tprivate _updateLightBulbPosition(marginDomNode: HTMLElement, y: number, lineHeight: number): number {\n\t\tconst { top } = getDomNodePagePosition(marginDomNode);\n\t\tconst offset = y - top;\n\t\tconst lineNumberOffset = Math.floor(offset / lineHeight);\n\t\tconst newTop = lineNumberOffset * lineHeight;\n\t\tthis._diffActions.style.top = `${newTop}px`;\n\t\tif (this._viewLineCounts) {\n\t\t\tlet acc = 0;\n\t\t\tfor (let i = 0; i < this._viewLineCounts.length; i++) {\n\t\t\t\tacc += this._viewLineCounts[i];\n\t\t\t\tif (lineNumberOffset < acc) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn lineNumberOffset;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,6BAA6B,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC9G,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACxE,OAAO,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,4CAA4C,CAAC;AAOvE,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,MAAM,OAAO,2BAA4B,SAAQ,UAAU;IAK1D,IAAI,UAAU;QACb,OAAO,IAAI,CAAC,WAAW,CAAC;IACzB,CAAC;IAED,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CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBACtD,GAAG,IAAI,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;gBAC/B,IAAI,gBAAgB,GAAG,GAAG,EAAE,CAAC;oBAC5B,OAAO,CAAC,CAAC;gBACV,CAAC;YACF,CAAC;QACF,CAAC;QACD,OAAO,gBAAgB,CAAC;IACzB,CAAC;CACD","file":"inlineDiffDeletedCodeMargin.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 { addStandardDisposableListener, getDomNodePagePosition } from '../../../../../../base/browser/dom.js';\nimport { Action } from '../../../../../../base/common/actions.js';\nimport { Codicon } from '../../../../../../base/common/codicons.js';\nimport { Disposable } from '../../../../../../base/common/lifecycle.js';\nimport { isIOS } from '../../../../../../base/common/platform.js';\nimport { ThemeIcon } from '../../../../../../base/common/themables.js';\nimport { IEditorMouseEvent, MouseTargetType } from '../../../../editorBrowser.js';\nimport { CodeEditorWidget } from '../../../codeEditor/codeEditorWidget.js';\nimport { DiffEditorWidget } from '../../diffEditorWidget.js';\nimport { EditorOption } from '../../../../../common/config/editorOptions.js';\nimport { DetailedLineRangeMapping } from '../../../../../common/diff/rangeMapping.js';\nimport { EndOfLineSequence, ITextModel } from '../../../../../common/model.js';\nimport { localize } from '../../../../../../nls.js';\nimport { IClipboardService } from '../../../../../../platform/clipboard/common/clipboardService.js';\nimport { IContextMenuService } from '../../../../../../platform/contextview/browser/contextView.js';\nimport { enableCopySelection } from './copySelection.js';\n\nexport class InlineDiffDeletedCodeMargin extends Disposable {\n\tprivate readonly _diffActions: HTMLElement;\n\n\tprivate _visibility: boolean = false;\n\n\tget visibility(): boolean {\n\t\treturn this._visibility;\n\t}\n\n\tset visibility(_visibility: boolean) {\n\t\tif (this._visibility !== _visibility) {\n\t\t\tthis._visibility = _visibility;\n\t\t\tthis._diffActions.style.visibility = _visibility ? 'visible' : 'hidden';\n\t\t}\n\t}\n\n\tconstructor(\n\t\tprivate readonly _getViewZoneId: () => string,\n\t\tprivate readonly _marginDomNode: HTMLElement,\n\t\tprivate readonly _deletedCodeDomNode: HTMLElement,\n\t\tprivate readonly _modifiedEditor: CodeEditorWidget,\n\t\tprivate readonly _diff: DetailedLineRangeMapping,\n\t\tprivate readonly _editor: DiffEditorWidget,\n\t\tprivate readonly _viewLineCounts: number[],\n\t\tprivate readonly _originalTextModel: ITextModel,\n\t\tprivate readonly _contextMenuService: IContextMenuService,\n\t\tprivate readonly _clipboardService: IClipboardService,\n\t) {\n\t\tsuper();\n\n\t\t// make sure the diff margin shows above overlay.\n\t\tthis._marginDomNode.style.zIndex = '10';\n\n\t\tthis._diffActions = document.createElement('div');\n\t\tthis._diffActions.className = ThemeIcon.asClassName(Codicon.lightBulb) + ' lightbulb-glyph';\n\t\tthis._diffActions.style.position = 'absolute';\n\t\tconst lineHeight = this._modifiedEditor.getOption(EditorOption.lineHeight);\n\t\tthis._diffActions.style.right = '0px';\n\t\tthis._diffActions.style.visibility = 'hidden';\n\t\tthis._diffActions.style.height = `${lineHeight}px`;\n\t\tthis._diffActions.style.lineHeight = `${lineHeight}px`;\n\t\tthis._marginDomNode.appendChild(this._diffActions);\n\n\t\tlet currentLineNumberOffset = 0;\n\n\t\tconst useShadowDOM = _modifiedEditor.getOption(EditorOption.useShadowDOM) && !isIOS; // Do not use shadow dom on IOS #122035\n\t\tconst showContextMenu = (anchor: { x: number; y: number }, baseActions?: Action[], onHide?: () => void) => {\n\t\t\tthis._contextMenuService.showContextMenu({\n\t\t\t\tdomForShadowRoot: useShadowDOM ? _modifiedEditor.getDomNode() ?? undefined : undefined,\n\t\t\t\tgetAnchor: () => anchor,\n\t\t\t\tonHide,\n\t\t\t\tgetActions: () => {\n\t\t\t\t\tconst actions: Action[] = baseActions ?? [];\n\t\t\t\t\tconst isDeletion = _diff.modified.isEmpty;\n\n\t\t\t\t\t// default action\n\t\t\t\t\tactions.push(new Action(\n\t\t\t\t\t\t'diff.clipboard.copyDeletedContent',\n\t\t\t\t\t\tisDeletion\n\t\t\t\t\t\t\t? (_diff.original.length > 1\n\t\t\t\t\t\t\t\t? localize('diff.clipboard.copyDeletedLinesContent.label', \"Copy deleted lines\")\n\t\t\t\t\t\t\t\t: localize('diff.clipboard.copyDeletedLinesContent.single.label', \"Copy deleted line\"))\n\t\t\t\t\t\t\t: (_diff.original.length > 1\n\t\t\t\t\t\t\t\t? localize('diff.clipboard.copyChangedLinesContent.label', \"Copy changed lines\")\n\t\t\t\t\t\t\t\t: localize('diff.clipboard.copyChangedLinesContent.single.label', \"Copy changed line\")),\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\ttrue,\n\t\t\t\t\t\tasync () => {\n\t\t\t\t\t\t\tconst originalText = this._originalTextModel.getValueInRange(_diff.original.toExclusiveRange());\n\t\t\t\t\t\t\tawait this._clipboardService.writeText(originalText);\n\t\t\t\t\t\t}\n\t\t\t\t\t));\n\n\t\t\t\t\tif (_diff.original.length > 1) {\n\t\t\t\t\t\tactions.push(new Action(\n\t\t\t\t\t\t\t'diff.clipboard.copyDeletedLineContent',\n\t\t\t\t\t\t\tisDeletion\n\t\t\t\t\t\t\t\t? localize('diff.clipboard.copyDeletedLineContent.label', \"Copy deleted line ({0})\",\n\t\t\t\t\t\t\t\t\t_diff.original.startLineNumber + currentLineNumberOffset)\n\t\t\t\t\t\t\t\t: localize('diff.clipboard.copyChangedLineContent.label', \"Copy changed line ({0})\",\n\t\t\t\t\t\t\t\t\t_diff.original.startLineNumber + currentLineNumberOffset),\n\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\tasync () => {\n\t\t\t\t\t\t\t\tlet lineContent = this._originalTextModel.getLineContent(_diff.original.startLineNumber + currentLineNumberOffset);\n\t\t\t\t\t\t\t\tif (lineContent === '') {\n\t\t\t\t\t\t\t\t\t// empty line -> new line\n\t\t\t\t\t\t\t\t\tconst eof = this._originalTextModel.getEndOfLineSequence();\n\t\t\t\t\t\t\t\t\tlineContent = eof === EndOfLineSequence.LF ? '\\n' : '\\r\\n';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tawait this._clipboardService.writeText(lineContent);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\t\t\t\t\tconst readOnly = _modifiedEditor.getOption(EditorOption.readOnly);\n\t\t\t\t\tif (!readOnly) {\n\t\t\t\t\t\tactions.push(new Action(\n\t\t\t\t\t\t\t'diff.inline.revertChange',\n\t\t\t\t\t\t\tlocalize('diff.inline.revertChange.label', \"Revert this change\"),\n\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\tasync () => {\n\t\t\t\t\t\t\t\tthis._editor.revert(this._diff);\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\treturn actions;\n\t\t\t\t},\n\t\t\t\tautoSelectFirstItem: true\n\t\t\t});\n\t\t};\n\n\t\tthis._register(addStandardDisposableListener(this._diffActions, 'mousedown', e => {\n\t\t\tif (!e.leftButton) { return; }\n\n\t\t\tconst { top, height } = getDomNodePagePosition(this._diffActions);\n\t\t\tconst pad = Math.floor(lineHeight / 3);\n\t\t\te.preventDefault();\n\t\t\tshowContextMenu({ x: e.posx, y: top + height + pad });\n\t\t}));\n\n\t\tthis._register(_modifiedEditor.onMouseMove((e: IEditorMouseEvent) => {\n\t\t\tif ((e.target.type === MouseTargetType.CONTENT_VIEW_ZONE || e.target.type === MouseTargetType.GUTTER_VIEW_ZONE) && e.target.detail.viewZoneId === this._getViewZoneId()) {\n\t\t\t\tcurrentLineNumberOffset = this._updateLightBulbPosition(this._marginDomNode, e.event.browserEvent.y, lineHeight);\n\t\t\t\tthis.visibility = true;\n\t\t\t} else {\n\t\t\t\tthis.visibility = false;\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(enableCopySelection({\n\t\t\tdomNode: this._deletedCodeDomNode,\n\t\t\tgetViewZoneId: () => this._getViewZoneId(),\n\t\t\tdiffEntry: _diff,\n\t\t\toriginalModel: this._originalTextModel,\n\t\t\teditorLineHeight: lineHeight,\n\t\t\tviewLineCounts: this._viewLineCounts,\n\t\t\teditor: _modifiedEditor,\n\t\t\tshowContextMenu,\n\t\t\tclipboardService: _clipboardService,\n\t\t}));\n\t}\n\n\tprivate _updateLightBulbPosition(marginDomNode: HTMLElement, y: number, lineHeight: number): number {\n\t\tconst { top } = getDomNodePagePosition(marginDomNode);\n\t\tconst offset = y - top;\n\t\tconst lineNumberOffset = Math.floor(offset / lineHeight);\n\t\tconst newTop = lineNumberOffset * lineHeight;\n\t\tthis._diffActions.style.top = `${newTop}px`;\n\t\tif (this._viewLineCounts) {\n\t\t\tlet acc = 0;\n\t\t\tfor (let i = 0; i < this._viewLineCounts.length; i++) {\n\t\t\t\tacc += this._viewLineCounts[i];\n\t\t\t\tif (lineNumberOffset < acc) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn lineNumberOffset;\n\t}\n}\n"]}
|