Skip to content

Commit 38695f1

Browse files
committed
1 parent 1a54634 commit 38695f1

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/vs/editor/browser/widget/diffEditor/features/gutterFeature.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export class DiffEditorGutter extends Disposable {
8484
const currentDiff = this._currentDiff.read(reader);
8585

8686
return diffs.mappings.map(m => new DiffGutterItem(
87-
m.lineRangeMapping,
87+
m.lineRangeMapping.withInnerChangesFromLineRanges(),
8888
m.lineRangeMapping === currentDiff?.lineRangeMapping,
8989
MenuId.DiffEditorHunkToolbar,
9090
undefined,

src/vs/editor/common/diff/rangeMapping.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ export class DetailedLineRangeMapping extends LineRangeMapping {
118118
public override flip(): DetailedLineRangeMapping {
119119
return new DetailedLineRangeMapping(this.modified, this.original, this.innerChanges?.map(c => c.flip()));
120120
}
121+
122+
public withInnerChangesFromLineRanges(): DetailedLineRangeMapping {
123+
return new DetailedLineRangeMapping(this.original, this.modified, [
124+
new RangeMapping(this.original.toExclusiveRange(), this.modified.toExclusiveRange()),
125+
]);
126+
}
121127
}
122128

123129
/**

0 commit comments

Comments
 (0)