From a1bc14d38dc6b224b6074045c4794c353b21b19a Mon Sep 17 00:00:00 2001 From: Marc Goodner Date: Mon, 2 Dec 2024 17:48:19 -0800 Subject: [PATCH] improve line ending docs --- src/filesystem/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/filesystem/index.ts b/src/filesystem/index.ts index ebe84a08..8ebae2fa 100644 --- a/src/filesystem/index.ts +++ b/src/filesystem/index.ts @@ -224,6 +224,12 @@ async function searchFiles( } // Line ending detection and normalization utilities +// These functions ensure consistent behavior across different platforms and Git configurations. +// They handle the following scenarios: +// - Windows CRLF (\r\n) vs Unix LF (\n) line endings +// - Git's core.autocrlf setting converting line endings +// - Mixed line endings within the same file +// This makes the edit functionality reliable regardless of the development environment. function detectLineEnding(content: string): string { // Check if the content contains CRLF if (content.includes('\r\n')) {