Skip to content

Fix splitting source into lines on Windows OS when source file contains Linux line ending characters ("\n"). #190

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

Conversation

gslowikowski
Copy link
Member

In this case code grid report doesn't split source file into lines at all because it tries to split on Windows line ending sequence ("\r\n") and there is no such sequence in source file.

'\r' characters should be treated as every other character (as it's treated now on Linux OS when source file contains Windows line ending sequences). Only '\n' characters should be used to split source into lines. It will work even if source file has mixed line endings.

…ns Linux line ending characters ("\n").

In this case code grid report doesn't split source file into lines at all because it tries to split on Windows line ending sequence ("\r\n") and there is no such sequence in source file.

'\r' characters should be treated as every other character (as it's treated now on Linux OS when source file contains Windows line ending sequences). Only '\n' characters should be used to split source into lines. It will work even if source file has mixed line endings.
@gslowikowski
Copy link
Member Author

Currently code grid report looks like this (there is only line no. 1):

scalac-scoverage-plugin-190

@gslowikowski gslowikowski merged commit ae743d5 into scoverage:master Aug 14, 2017
@gslowikowski gslowikowski deleted the linux-newlines-on-windows-support-in-codegrid branch August 26, 2017 21:15
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.

1 participant