Skip to content

Conversation

@ranqn
Copy link

@ranqn ranqn commented Jan 19, 2026

What does this PR do?

Fixes #2016 : The issue was closed but only the diff view was fixed back then, this PR actually fixed the root problem, which happens a lot on Windows when editing CRLF files, resulting in files with mixed line endings.

On editing CRLF files, the problem also causes an extra blank line being inserted if an edit's newString ends with a new line (\n). Sometimes an agent gets stuck in a loop to fix the extra new line, wasting a lot of tokens.

How did you verify your code works?

  • Added new edit tool tests to verify different line ending combinations.
  • Verified in a local build, mixed line endings and extra new lines are gone.

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

The search found PR #2017, which is related to the same issue (2016) mentioned in the current PR. However, since the current PR notes that issue #2016 was "closed but only the diff view was fixed back then," PR #2017 appears to be a previous partial fix.

Potential Related PR:

These are related PRs addressing the same issue, but PR #2017 is an earlier incomplete fix, not a duplicate. PR #9443 is the comprehensive fix for the root problem.

@rekram1-node rekram1-node requested a review from Hona January 19, 2026 20:48
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.

Windows line endings get replaced with linux line endings on edits

1 participant