diff --git a/compiler/src/dotty/tools/repl/terminal/Utils.scala b/compiler/src/dotty/tools/repl/terminal/Utils.scala index dad7dc61dd5f..ddf234b2bac8 100644 --- a/compiler/src/dotty/tools/repl/terminal/Utils.scala +++ b/compiler/src/dotty/tools/repl/terminal/Utils.scala @@ -199,8 +199,9 @@ object FrontEndUtils { .grouped(math.ceil(snippets.length * 1.0 / columns).toInt) .toList - transpose(grouped).iterator.flatMap { - case first :+ last => first.map( + transpose(grouped).iterator.flatMap { group => + val last = group.last + group.init.map( x => x ++ " " * (width / columns - x.length) ) :+ last :+ Ansi.Str.parse(newLine) }