From cc0259e6b36bf99bd67aad35feba8a6e902ca9cf Mon Sep 17 00:00:00 2001 From: Nate Date: Thu, 5 Sep 2024 17:52:12 -0700 Subject: [PATCH] fix CRLF bug in diff stream --- core/util/verticalEdit.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/util/verticalEdit.ts b/core/util/verticalEdit.ts index 0a32a6a5b..34a17ebd4 100644 --- a/core/util/verticalEdit.ts +++ b/core/util/verticalEdit.ts @@ -81,6 +81,9 @@ export async function* streamDiffLines( oldLines = []; } + // Trim end of oldLines, otherwise we have trailing \r on every line for CRLF files + oldLines = oldLines.map((line) => line.trimEnd()); + const prompt = constructPrompt( prefix, highlighted,