From 448e42ab17418482b1da7072efc7c38c61cdad8c Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Mon, 26 Jun 2023 15:53:23 +0200 Subject: [PATCH] Improves diff decorations --- .../widget/diffEditorWidget2/diffEditorDecorations.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorDecorations.ts b/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorDecorations.ts index ccb4798c9021f..7c30bf1af98cc 100644 --- a/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorDecorations.ts +++ b/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorDecorations.ts @@ -61,8 +61,12 @@ export class DiffEditorDecorations extends Disposable { continue; } - originalDecorations.push({ range: i.originalRange, options: (i.originalRange.isEmpty() && showEmptyDecorations) ? diffDeleteDecorationEmpty : diffDeleteDecoration }); - modifiedDecorations.push({ range: i.modifiedRange, options: (i.modifiedRange.isEmpty() && showEmptyDecorations) ? diffAddDecorationEmpty : diffAddDecoration }); + if (i.originalRange.startLineNumber < m.lineRangeMapping.originalRange.endLineNumberExclusive) { + originalDecorations.push({ range: i.originalRange, options: (i.originalRange.isEmpty() && showEmptyDecorations) ? diffDeleteDecorationEmpty : diffDeleteDecoration }); + } + if (i.modifiedRange.startLineNumber < m.lineRangeMapping.modifiedRange.endLineNumberExclusive) { + modifiedDecorations.push({ range: i.modifiedRange, options: (i.modifiedRange.isEmpty() && showEmptyDecorations) ? diffAddDecorationEmpty : diffAddDecoration }); + } } if (!m.lineRangeMapping.modifiedRange.isEmpty && this._options.shouldRenderRevertArrows.read(reader) && !currentMove) {