|
6 | 6 | import { Disposable } from 'vs/base/common/lifecycle';
|
7 | 7 | import { IObservable, derived } from 'vs/base/common/observable';
|
8 | 8 | import { isDefined } from 'vs/base/common/types';
|
9 |
| -import { arrowRevertChange, diffAddDecoration, diffAddDecorationEmpty, diffDeleteDecoration, diffDeleteDecorationEmpty, diffLineAddDecorationBackground, diffLineAddDecorationBackgroundWithIndicator, diffLineDeleteDecorationBackground, diffLineDeleteDecorationBackgroundWithIndicator } from 'vs/editor/browser/widget/diffEditorWidget2/decorations'; |
| 9 | +import { arrowRevertChange, diffAddDecoration, diffAddDecorationEmpty, diffDeleteDecoration, diffDeleteDecorationEmpty, diffLineAddDecorationBackground, diffLineAddDecorationBackgroundWithIndicator, diffLineDeleteDecorationBackground, diffLineDeleteDecorationBackgroundWithIndicator, diffWholeLineAddDecoration, diffWholeLineDeleteDecoration } from 'vs/editor/browser/widget/diffEditorWidget2/decorations'; |
10 | 10 | import { DiffEditorEditors } from 'vs/editor/browser/widget/diffEditorWidget2/diffEditorEditors';
|
11 | 11 | import { DiffEditorOptions } from 'vs/editor/browser/widget/diffEditorWidget2/diffEditorOptions';
|
12 | 12 | import { DiffEditorViewModel } from 'vs/editor/browser/widget/diffEditorWidget2/diffEditorViewModel';
|
@@ -54,19 +54,28 @@ export class DiffEditorDecorations extends Disposable {
|
54 | 54 | modifiedDecorations.push({ range, options: renderIndicators ? diffLineAddDecorationBackgroundWithIndicator : diffLineAddDecorationBackground });
|
55 | 55 | }
|
56 | 56 |
|
57 |
| - for (const i of m.lineRangeMapping.innerChanges || []) { |
58 |
| - if (currentMove |
59 |
| - && (currentMove.lineRangeMapping.originalRange.intersect(new LineRange(i.originalRange.startLineNumber, i.originalRange.endLineNumber)) |
60 |
| - || currentMove.lineRangeMapping.modifiedRange.intersect(new LineRange(i.modifiedRange.startLineNumber, i.modifiedRange.endLineNumber)))) { |
61 |
| - continue; |
| 57 | + if (m.lineRangeMapping.modifiedRange.isEmpty || m.lineRangeMapping.originalRange.isEmpty) { |
| 58 | + for (const range of fullRangeOriginal) { |
| 59 | + originalDecorations.push({ range, options: diffWholeLineDeleteDecoration }); |
62 | 60 | }
|
63 |
| - |
64 |
| - // Don't show empty markers outside the line range |
65 |
| - if (m.lineRangeMapping.originalRange.contains(i.originalRange.startLineNumber)) { |
66 |
| - originalDecorations.push({ range: i.originalRange, options: (i.originalRange.isEmpty() && showEmptyDecorations) ? diffDeleteDecorationEmpty : diffDeleteDecoration }); |
| 61 | + for (const range of fullRangeModified) { |
| 62 | + modifiedDecorations.push({ range, options: diffWholeLineAddDecoration }); |
67 | 63 | }
|
68 |
| - if (m.lineRangeMapping.modifiedRange.contains(i.modifiedRange.startLineNumber)) { |
69 |
| - modifiedDecorations.push({ range: i.modifiedRange, options: (i.modifiedRange.isEmpty() && showEmptyDecorations) ? diffAddDecorationEmpty : diffAddDecoration }); |
| 64 | + } else { |
| 65 | + for (const i of m.lineRangeMapping.innerChanges || []) { |
| 66 | + if (currentMove |
| 67 | + && (currentMove.lineRangeMapping.originalRange.intersect(new LineRange(i.originalRange.startLineNumber, i.originalRange.endLineNumber)) |
| 68 | + || currentMove.lineRangeMapping.modifiedRange.intersect(new LineRange(i.modifiedRange.startLineNumber, i.modifiedRange.endLineNumber)))) { |
| 69 | + continue; |
| 70 | + } |
| 71 | + |
| 72 | + // Don't show empty markers outside the line range |
| 73 | + if (m.lineRangeMapping.originalRange.contains(i.originalRange.startLineNumber)) { |
| 74 | + originalDecorations.push({ range: i.originalRange, options: (i.originalRange.isEmpty() && showEmptyDecorations) ? diffDeleteDecorationEmpty : diffDeleteDecoration }); |
| 75 | + } |
| 76 | + if (m.lineRangeMapping.modifiedRange.contains(i.modifiedRange.startLineNumber)) { |
| 77 | + modifiedDecorations.push({ range: i.modifiedRange, options: (i.modifiedRange.isEmpty() && showEmptyDecorations) ? diffAddDecorationEmpty : diffAddDecoration }); |
| 78 | + } |
70 | 79 | }
|
71 | 80 | }
|
72 | 81 |
|
|
0 commit comments