@@ -43,6 +43,7 @@ import { ITheme, IThemeService, getThemeTypeSelector, registerThemingParticipant
4343import { IContextMenuService } from 'vs/platform/contextview/browser/contextView' ;
4444import { IDiffLinesChange , InlineDiffMargin } from 'vs/editor/browser/widget/inlineDiffMargin' ;
4545import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService' ;
46+ import { Constants } from 'vs/base/common/uint' ;
4647
4748interface IEditorDiffDecorations {
4849 decorations : IModelDeltaDecoration [ ] ;
@@ -1122,7 +1123,7 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
11221123 while ( min < max ) {
11231124 let mid = Math . floor ( ( min + max ) / 2 ) ;
11241125 let midStart = startLineNumberExtractor ( lineChanges [ mid ] ) ;
1125- let midEnd = ( mid + 1 <= max ? startLineNumberExtractor ( lineChanges [ mid + 1 ] ) : Number . MAX_VALUE ) ;
1126+ let midEnd = ( mid + 1 <= max ? startLineNumberExtractor ( lineChanges [ mid + 1 ] ) : Constants . MAX_SAFE_SMALL_INTEGER ) ;
11261127
11271128 if ( lineNumber < midStart ) {
11281129 max = mid - 1 ;
@@ -1682,11 +1683,11 @@ class DiffEditorWidgetSideBySide extends DiffEditorWidgetStyle implements IDiffE
16821683
16831684 if ( isChangeOrDelete ( lineChange ) ) {
16841685 result . decorations . push ( {
1685- range : new Range ( lineChange . originalStartLineNumber , 1 , lineChange . originalEndLineNumber , Number . MAX_VALUE ) ,
1686+ range : new Range ( lineChange . originalStartLineNumber , 1 , lineChange . originalEndLineNumber , Constants . MAX_SAFE_SMALL_INTEGER ) ,
16861687 options : ( renderIndicators ? DECORATIONS . lineDeleteWithSign : DECORATIONS . lineDelete )
16871688 } ) ;
16881689 if ( ! isChangeOrInsert ( lineChange ) || ! lineChange . charChanges ) {
1689- result . decorations . push ( createDecoration ( lineChange . originalStartLineNumber , 1 , lineChange . originalEndLineNumber , Number . MAX_VALUE , DECORATIONS . charDeleteWholeLine ) ) ;
1690+ result . decorations . push ( createDecoration ( lineChange . originalStartLineNumber , 1 , lineChange . originalEndLineNumber , Constants . MAX_SAFE_SMALL_INTEGER , DECORATIONS . charDeleteWholeLine ) ) ;
16901691 }
16911692
16921693 result . overviewZones . push ( new OverviewRulerZone (
@@ -1743,11 +1744,11 @@ class DiffEditorWidgetSideBySide extends DiffEditorWidgetStyle implements IDiffE
17431744 if ( isChangeOrInsert ( lineChange ) ) {
17441745
17451746 result . decorations . push ( {
1746- range : new Range ( lineChange . modifiedStartLineNumber , 1 , lineChange . modifiedEndLineNumber , Number . MAX_VALUE ) ,
1747+ range : new Range ( lineChange . modifiedStartLineNumber , 1 , lineChange . modifiedEndLineNumber , Constants . MAX_SAFE_SMALL_INTEGER ) ,
17471748 options : ( renderIndicators ? DECORATIONS . lineInsertWithSign : DECORATIONS . lineInsert )
17481749 } ) ;
17491750 if ( ! isChangeOrDelete ( lineChange ) || ! lineChange . charChanges ) {
1750- result . decorations . push ( createDecoration ( lineChange . modifiedStartLineNumber , 1 , lineChange . modifiedEndLineNumber , Number . MAX_VALUE , DECORATIONS . charInsertWholeLine ) ) ;
1751+ result . decorations . push ( createDecoration ( lineChange . modifiedStartLineNumber , 1 , lineChange . modifiedEndLineNumber , Constants . MAX_SAFE_SMALL_INTEGER , DECORATIONS . charInsertWholeLine ) ) ;
17511752 }
17521753 result . overviewZones . push ( new OverviewRulerZone (
17531754 lineChange . modifiedStartLineNumber ,
@@ -1861,7 +1862,7 @@ class DiffEditorWidgetInline extends DiffEditorWidgetStyle implements IDiffEdito
18611862 // Add overview zones in the overview ruler
18621863 if ( isChangeOrDelete ( lineChange ) ) {
18631864 result . decorations . push ( {
1864- range : new Range ( lineChange . originalStartLineNumber , 1 , lineChange . originalEndLineNumber , Number . MAX_VALUE ) ,
1865+ range : new Range ( lineChange . originalStartLineNumber , 1 , lineChange . originalEndLineNumber , Constants . MAX_SAFE_SMALL_INTEGER ) ,
18651866 options : DECORATIONS . lineDeleteMargin
18661867 } ) ;
18671868
@@ -1892,7 +1893,7 @@ class DiffEditorWidgetInline extends DiffEditorWidgetStyle implements IDiffEdito
18921893 // Add decorations & overview zones
18931894 if ( isChangeOrInsert ( lineChange ) ) {
18941895 result . decorations . push ( {
1895- range : new Range ( lineChange . modifiedStartLineNumber , 1 , lineChange . modifiedEndLineNumber , Number . MAX_VALUE ) ,
1896+ range : new Range ( lineChange . modifiedStartLineNumber , 1 , lineChange . modifiedEndLineNumber , Constants . MAX_SAFE_SMALL_INTEGER ) ,
18961897 options : ( renderIndicators ? DECORATIONS . lineInsertWithSign : DECORATIONS . lineInsert )
18971898 } ) ;
18981899
@@ -1928,7 +1929,7 @@ class DiffEditorWidgetInline extends DiffEditorWidgetStyle implements IDiffEdito
19281929 }
19291930 }
19301931 } else {
1931- result . decorations . push ( createDecoration ( lineChange . modifiedStartLineNumber , 1 , lineChange . modifiedEndLineNumber , Number . MAX_VALUE , DECORATIONS . charInsertWholeLine ) ) ;
1932+ result . decorations . push ( createDecoration ( lineChange . modifiedStartLineNumber , 1 , lineChange . modifiedEndLineNumber , Constants . MAX_SAFE_SMALL_INTEGER , DECORATIONS . charInsertWholeLine ) ) ;
19321933 }
19331934 }
19341935 }
0 commit comments