-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.Rd files are forcibly rewritten with LF ending on Windows #989
Comments
@jimhester can you please take a look? |
This is really annoying. For a project created on Windows, with .Rd files created by |
Works for me, but produces bogus |
Just ran Still seeing Before:
After
|
@sz-cgt you'll need to install from the PR: |
Oops. Thanks. The PR works for me |
We need to move the detection of line endings upstream a bit, to be able to tell if the newly generated contents is different from the current one, in write_if_different(). This means that we need to paste() the contents together in write_if_different(). Consequently, we might as well remove the paste()-ing from same_contents(), as write_if_different() always calls it with the paste()-d contents. Also, if we paste() already upstream, then we might as well use writeBin() to write out the contents, instead of write_lines(), especially because write_lines() would add an extra empty line. write_lines() is still kept, and used in some code paths, and it can also do EOL-detection, although this feature is not used currently. Another benefit of this refactoring is that we also move enc2utf8() upstream, this should clearly happen before we check if the new contents is different. Added test cases as well. Fixes #989, supersedes #1003.
despite of what's announced in the NEWS and in #841.
To reproduce:
unix2dos man/*.Rd
devtools::document()
I believe this is because
write_if_different()
already receives character strings with embedded newlines, andwrite_lines()
doesn't convert them to the detected newlines.The text was updated successfully, but these errors were encountered: