opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Issue 2016: edits change windows line endings to linux endings

Open cvzakharchenko opened this issue 4 months ago • 1 comments

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) }

cvzakharchenko avatar Aug 17 '25 15:08 cvzakharchenko

@thdxr It's a nice fix of an annoying problem. Can you please consider it?

cvzakharchenko avatar Sep 11 '25 09:09 cvzakharchenko