mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-20 02:08:47 +00:00
Fixes #193367
This commit is contained in:
committed by
Henning Dieterichs
parent
bfb541540f
commit
79a3ef5a7d
@@ -307,14 +307,12 @@ function joinCloseConsecutiveMoves(moves: LineRangeMapping[]): LineRangeMapping[
|
|||||||
function removeMovesInSameDiff(changes: DetailedLineRangeMapping[], moves: LineRangeMapping[]) {
|
function removeMovesInSameDiff(changes: DetailedLineRangeMapping[], moves: LineRangeMapping[]) {
|
||||||
const changesMonotonous = new MonotonousArray(changes);
|
const changesMonotonous = new MonotonousArray(changes);
|
||||||
moves = moves.filter(m => {
|
moves = moves.filter(m => {
|
||||||
const diffBeforeOriginalMove = changesMonotonous.findLastMonotonous(c => c.original.endLineNumberExclusive <= m.original.startLineNumber)
|
const diffBeforeEndOfMoveOriginal = changesMonotonous.findLastMonotonous(c => c.original.endLineNumberExclusive < m.original.endLineNumberExclusive)
|
||||||
|| new LineRangeMapping(new LineRange(1, 1), new LineRange(1, 1));
|
|| new LineRangeMapping(new LineRange(1, 1), new LineRange(1, 1));
|
||||||
|
const diffBeforeEndOfMoveModified = findLastMonotonous(changes, c => c.modified.endLineNumberExclusive < m.modified.endLineNumberExclusive);
|
||||||
|
|
||||||
const modifiedDistToPrevDiff = m.modified.startLineNumber - diffBeforeOriginalMove.modified.endLineNumberExclusive;
|
const differentDiffs = diffBeforeEndOfMoveOriginal !== diffBeforeEndOfMoveModified;
|
||||||
const originalDistToPrevDiff = m.original.startLineNumber - diffBeforeOriginalMove.original.endLineNumberExclusive;
|
return differentDiffs;
|
||||||
|
|
||||||
const differentDistances = modifiedDistToPrevDiff !== originalDistToPrevDiff;
|
|
||||||
return differentDistances;
|
|
||||||
});
|
});
|
||||||
return moves;
|
return moves;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user