Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jun 10, 2020. It is now read-only.

Commit a119b51

Browse files
authored
Merge pull request #228 from eatkins/1.3.x-delete-line-count-backport
[1.3.x] Don't include DeleteLine in progress length backport
2 parents 4e43057 + 263d318 commit a119b51

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

internal/util-logging/src/main/scala/sbt/internal/util/ConsoleAppender.scala

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,13 +349,18 @@ class ConsoleAppender private[ConsoleAppender] (
349349
val width = ConsoleAppender.terminalWidth
350350
val len: Int = progress.foldLeft(progress.length)(_ + terminalLines(width)(_))
351351
deleteConsoleLines(blankZone + pad)
352-
progress.foreach(out.println)
352+
progress.foreach(printProgressLine)
353353
out.print(cursorUp(blankZone + len + padding.get))
354354
}
355355
}
356356
out.flush()
357357
}
358358

359+
private def printProgressLine(line: String): Unit = {
360+
out.print(DeleteLine)
361+
out.println(line)
362+
}
363+
359364
/**
360365
* Receives a new task report and replaces the old one. In the event that the new
361366
* report has fewer lines than the previous report, padding lines are added on top
@@ -369,7 +374,7 @@ class ConsoleAppender private[ConsoleAppender] (
369374
val sorted = pe.items.sortBy(x => x.elapsedMicros)
370375
val info = sorted map { item =>
371376
val elapsed = item.elapsedMicros / 1000000L
372-
s"$DeleteLine | => ${item.name} ${elapsed}s"
377+
s" | => ${item.name} ${elapsed}s"
373378
}
374379

375380
val width = ConsoleAppender.terminalWidth
@@ -383,7 +388,7 @@ class ConsoleAppender private[ConsoleAppender] (
383388

384389
deleteConsoleLines(newPadding)
385390
deleteConsoleLines(blankZone)
386-
info.foreach(i => out.println(i))
391+
info.foreach(printProgressLine)
387392

388393
out.print(cursorUp(blankZone + currentLength + newPadding))
389394
out.flush()

0 commit comments

Comments
 (0)