Skip to content

Commit b24844c

Browse files
committed
Fixes microsoft#72823: Do not compute char changes for huge chunks
1 parent e57a827 commit b24844c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,8 @@ class LineChange implements ILineChange {
249249
modifiedEndLineNumber = modifiedLineSequence.getEndLineNumber(diffChange.modifiedStart + diffChange.modifiedLength - 1);
250250
}
251251

252-
if (shouldComputeCharChanges && diffChange.originalLength !== 0 && diffChange.modifiedLength !== 0 && continueProcessingPredicate()) {
252+
if (shouldComputeCharChanges && diffChange.originalLength > 0 && diffChange.originalLength < 20 && diffChange.modifiedLength > 0 && diffChange.modifiedLength < 20 && continueProcessingPredicate()) {
253+
// Compute character changes for diff chunks of at most 20 lines...
253254
const originalCharSequence = originalLineSequence.createCharSequence(shouldIgnoreTrimWhitespace, diffChange.originalStart, diffChange.originalStart + diffChange.originalLength - 1);
254255
const modifiedCharSequence = modifiedLineSequence.createCharSequence(shouldIgnoreTrimWhitespace, diffChange.modifiedStart, diffChange.modifiedStart + diffChange.modifiedLength - 1);
255256

0 commit comments

Comments
 (0)