Skip to content

Conversation

@akramcodez
Copy link

Description

EditTool was converting all CRLF line endings to LF during file edits, causing entire files to show as changed in Git even when only a single line was modified. This created friction for Windows and cross-platform teams.

Solution

  • Detect original line ending before normalization
  • Process edits with LF internally (existing behavior)
  • Restore original line ending format when writing file back
  • New files default to LF

Changes

  • edit.ts: Added line ending detection and restoration logic

Testing

  • CRLF files maintain CRLF after edits
  • LF files maintain LF after edits
  • Internal processing remains consistent with LF
  • New files use LF by default

fixes #11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Line Ending Normalization Breaks Existing File Conventions

1 participant