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