[PR #2017] Issue 2016: edits change windows line endings to linux endings #10163

Closed
opened 2026-02-16 18:14:46 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/2017

State: closed
Merged: No


https://github.com/sst/opencode/issues/2016

normalizedNewString is self-explanatory, but the LineTrimmedReplacer change makes sure an edit doesn't remove \r from the last line.

Also, I took the liberty of making LineTrimmedReplacer slightly more concise; it was not necessary. The important part is:

if (matchString.endsWith("\r")) {
matchString = matchString.slice(0, -1)
}

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/2017 **State:** closed **Merged:** No --- https://github.com/sst/opencode/issues/2016 normalizedNewString is self-explanatory, but the LineTrimmedReplacer change makes sure an edit doesn't remove \r from the last line. Also, I took the liberty of making LineTrimmedReplacer slightly more concise; it was not necessary. The important part is: if (matchString.endsWith("\r")) { matchString = matchString.slice(0, -1) }
yindo added the pull-request label 2026-02-16 18:14:46 -05:00
yindo closed this issue 2026-02-16 18:14:46 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#10163