* Fixes #210459

* Fixes CI
This commit is contained in:
Henning Dieterichs 2024-04-24 11:50:08 +02:00 committed by GitHub
parent e95d40385b
commit 5abb7572eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,7 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { $, getWindow, h } from 'vs/base/browser/dom';
import { getWindow, h } from 'vs/base/browser/dom';
import { IBoundarySashes } from 'vs/base/browser/ui/sash/sash';
import { findLast } from 'vs/base/common/arraysFind';
import { onUnexpectedError } from 'vs/base/common/errors';
@ -21,6 +21,7 @@ import { AccessibleDiffViewer, AccessibleDiffViewerModelFromEditors } from 'vs/e
import { DiffEditorDecorations } from 'vs/editor/browser/widget/diffEditor/components/diffEditorDecorations';
import { DiffEditorSash } from 'vs/editor/browser/widget/diffEditor/components/diffEditorSash';
import { DiffEditorViewZones } from 'vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones';
import { DiffEditorGutter } from 'vs/editor/browser/widget/diffEditor/features/gutterFeature';
import { HideUnchangedRegionsFeature } from 'vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature';
import { MovedBlocksLinesFeature } from 'vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature';
import { OverviewRulerFeature } from 'vs/editor/browser/widget/diffEditor/features/overviewRulerFeature';
@ -45,7 +46,6 @@ import { DiffEditorEditors } from './components/diffEditorEditors';
import { DelegatingEditor } from './delegatingEditorImpl';
import { DiffEditorOptions } from './diffEditorOptions';
import { DiffEditorViewModel, DiffMapping, DiffState } from './diffEditorViewModel';
import { DiffEditorGutter } from 'vs/editor/browser/widget/diffEditor/features/gutterFeature';
export interface IDiffCodeEditorWidgetOptions {
originalEditor?: ICodeEditorWidgetOptions;
@ -56,7 +56,6 @@ export class DiffEditorWidget extends DelegatingEditor implements IDiffEditor {
public static ENTIRE_DIFF_OVERVIEW_WIDTH = OverviewRulerFeature.ENTIRE_DIFF_OVERVIEW_WIDTH;
private readonly elements = h('div.monaco-diff-editor.side-by-side', { style: { position: 'relative', height: '100%' } }, [
h('div.noModificationsOverlay@overlay', { style: { position: 'absolute', height: '100%', visibility: 'hidden', } }, [$('span', {}, 'No Changes')]),
h('div.editor.original@original', { style: { position: 'absolute', height: '100%', } }),
h('div.editor.modified@modified', { style: { position: 'absolute', height: '100%', } }),
h('div.accessibleDiffViewer@accessibleDiffViewer', { style: { position: 'absolute', height: '100%' } }),
@ -293,17 +292,9 @@ export class DiffEditorWidget extends DelegatingEditor implements IDiffEditor {
this._movedBlocksLinesPart.set(value, undefined);
});
this._register(applyStyle(this.elements.overlay, {
width: this._layoutInfo.map((i, r) => i.originalEditor.width + (this._options.renderSideBySide.read(r) ? 0 : i.modifiedEditor.width)),
visibility: derived(reader => /** @description visibility */(this._options.hideUnchangedRegions.read(reader) && this._diffModel.read(reader)?.diff.read(reader)?.mappings.length === 0)
? 'visible' : 'hidden'
),
}));
this._register(Event.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition, e => this._handleCursorPositionChange(e, true)));
this._register(Event.runAndSubscribe(this._editors.original.onDidChangeCursorPosition, e => this._handleCursorPositionChange(e, false)));
const isInitializingDiff = this._diffModel.map(this, (m, reader) => {
/** @isInitializingDiff isDiffUpToDate */
if (!m) { return undefined; }