diff --git a/core/diff/streamDiff.ts b/core/diff/streamDiff.ts index 4daa30804..436da1c09 100644 --- a/core/diff/streamDiff.ts +++ b/core/diff/streamDiff.ts @@ -35,7 +35,6 @@ export async function* streamDiff( let type: DiffLineType; - let isLineRemoval = false; const isNewLine = matchIndex === -1; if (isNewLine) { @@ -45,7 +44,6 @@ export async function* streamDiff( for (let i = 0; i < matchIndex; i++) { yield { type: "old", line: oldLinesCopy.shift()! }; } - type = isPerfectMatch ? "same" : "old"; } @@ -60,22 +58,13 @@ export async function* streamDiff( case "old": yield { type, line: oldLinesCopy.shift()! }; - - if (oldLinesCopy[0] !== newLine) { - yield { type: "new", line: newLine }; - } else { - isLineRemoval = true; - } - + yield { type: "new", line: newLine }; break; default: console.error(`Error streaming diff, unrecognized diff type: ${type}`); } - - if (!isLineRemoval) { - newLineResult = await newLines.next(); - } + newLineResult = await newLines.next(); } // Once at the edge, only one choice