Skip to content

Commit f300b28

Browse files
committed
Fix issue with line spacing in Code Grid report on Windows, due
to the .split method being translated by StringLike.split into a regex [\r\n] which will cause 2 lines in the resultant array. Issue is resolved if treating as a single String, which will invoke the Java String.split(String regex) method, and correctly treat the "\r\n" as a single expression. This should work correctly on other platforms with a single character line ending (Unix and Mac).
1 parent 3b9ef28 commit f300b28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scalac-scoverage-plugin/src/main/scala/scoverage/report/CodeGrid.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class CodeGrid(mfile: MeasuredFile) {
99

1010
case class Cell(char: Char, var status: StatementStatus)
1111

12-
private val lineBreak = System.getProperty("line.separator").toCharArray
12+
private val lineBreak = System.getProperty("line.separator")
1313

1414
// note: we must reinclude the line sep to keep source positions correct.
1515
private val lines = source(mfile).split(lineBreak).map(line => (line.toCharArray ++ lineBreak).map(Cell(_, NoData)))

0 commit comments

Comments
 (0)