This commit is contained in:
Henning Dieterichs 2024-03-26 15:32:47 +01:00 committed by Henning Dieterichs
parent 1a54634c51
commit 38695f10be
2 changed files with 7 additions and 1 deletions

View file

@ -84,7 +84,7 @@ export class DiffEditorGutter extends Disposable {
const currentDiff = this._currentDiff.read(reader);
return diffs.mappings.map(m => new DiffGutterItem(
m.lineRangeMapping,
m.lineRangeMapping.withInnerChangesFromLineRanges(),
m.lineRangeMapping === currentDiff?.lineRangeMapping,
MenuId.DiffEditorHunkToolbar,
undefined,

View file

@ -118,6 +118,12 @@ export class DetailedLineRangeMapping extends LineRangeMapping {
public override flip(): DetailedLineRangeMapping {
return new DetailedLineRangeMapping(this.modified, this.original, this.innerChanges?.map(c => c.flip()));
}
public withInnerChangesFromLineRanges(): DetailedLineRangeMapping {
return new DetailedLineRangeMapping(this.original, this.modified, [
new RangeMapping(this.original.toExclusiveRange(), this.modified.toExclusiveRange()),
]);
}
}
/**