From cd55adf8a9f69fec8857fbcc33fab1d740cd01a6 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Thu, 19 Apr 2018 00:56:50 +0200 Subject: [PATCH] Fixes #43922 --- src/vs/editor/common/diff/diffComputer.ts | 2 +- .../test/common/diff/diffComputer.test.ts | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/vs/editor/common/diff/diffComputer.ts b/src/vs/editor/common/diff/diffComputer.ts index a1b88e19a4b0..6bccc31a789b 100644 --- a/src/vs/editor/common/diff/diffComputer.ts +++ b/src/vs/editor/common/diff/diffComputer.ts @@ -284,7 +284,7 @@ class LineChange implements ILineChange { const originalCharSequence = originalLineSequence.getCharSequence(diffChange.originalStart, diffChange.originalStart + diffChange.originalLength - 1); const modifiedCharSequence = modifiedLineSequence.getCharSequence(diffChange.modifiedStart, diffChange.modifiedStart + diffChange.modifiedLength - 1); - let rawChanges = computeDiff(originalCharSequence, modifiedCharSequence, continueProcessingPredicate, false); + let rawChanges = computeDiff(originalCharSequence, modifiedCharSequence, continueProcessingPredicate, true); if (shouldPostProcessCharChanges) { rawChanges = postProcessCharChanges(rawChanges); diff --git a/src/vs/editor/test/common/diff/diffComputer.test.ts b/src/vs/editor/test/common/diff/diffComputer.test.ts index 0d521de7eb85..dd513f434524 100644 --- a/src/vs/editor/test/common/diff/diffComputer.test.ts +++ b/src/vs/editor/test/common/diff/diffComputer.test.ts @@ -673,4 +673,23 @@ suite('Editor Diff - DiffComputer', () => { ]; assertDiff(original, modified, expected, true, false); }); + + test('issue #43922', () => { + let original = [ + ' * `yarn [install]` -- Install project NPM dependencies. This is automatically done when you first create the project. You should only need to run this if you add dependencies in `package.json`.', + ]; + let modified = [ + ' * `yarn` -- Install project NPM dependencies. You should only need to run this if you add dependencies in `package.json`.', + ]; + var expected = [ + createLineChange( + 1, 1, 1, 1, + [ + createCharChange(1, 9, 1, 19, 0, 0, 0, 0), + createCharChange(1, 58, 1, 120, 0, 0, 0, 0), + ] + ) + ]; + assertDiff(original, modified, expected, true, false); + }); });