-
Notifications
You must be signed in to change notification settings - Fork 458
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
Preserve CRLF line endings #606
base: dev
Are you sure you want to change the base?
Conversation
@@ -72,7 +72,7 @@ let option = { | |||
var lastIndex = spaces.lastIndexOf('\n'); | |||
|
|||
// Do not continue if there is no line break: | |||
if (lastIndex < 0) return; | |||
if (lastIndex === -1) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jdalton, out of curiosity, there'll be no bug/issue with this line, it's just a nitpick, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, sorry about that. No bug. I usually try to avoid unfocused changes like that.
Let me know if you spot others like it and I’ll revert them.
@jdalton, is this PR still WIP? |
Yes! I still need add detection of newline use based on the nearest other newline instead of using ‘os.EOL’. Update: I'm getting closer. I've added a |
Please tell me what's wrong with this edit? |
This PR preserves CRLF line endings and addresses #367, #498, #572, #578, #592, #593.
Update:
Still needs tests.
Update:
I'm manually testing on Windows and finding some issues with this PR.
I'll update as I resolve them 👷
Update:
I'll add logic to detect existing line endings used to avoid using
os.EOL
in certain situations.