Skip to content

Commit 02ea6f4

Browse files
committed
refactor: reuse info text re truncation
1 parent 1475a6f commit 02ea6f4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

compiler/src/dotty/tools/repl/Rendering.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,9 @@ private[repl] class Rendering(parentClassLoader: Option[ClassLoader] = None):
9090
/** Used to elide long output in replStringOf via `-Vrepl-max-print-characters` */
9191
private[repl] def truncate(str: String)(using ctx: Context): String =
9292
val maxPrintCharacters = ctx.settings.VreplMaxPrintCharacters.valueIn(ctx.settingsState)
93-
val showTruncated = " ... large output truncated, print value to show all"
9493
val ncp = str.codePointCount(0, str.length) // to not cut inside code point
9594
if ncp <= maxPrintCharacters then str
96-
else str.substring(0, str.offsetByCodePoints(0, maxPrintCharacters - 1)) + showTruncated
95+
else str.substring(0, str.offsetByCodePoints(0, maxPrintCharacters - 1)) + infoOutputGotTruncated
9796

9897
/** Return a String representation of a value we got from `classLoader()`. */
9998
private[repl] def replStringOf(value: Object)(using Context): String =

0 commit comments

Comments
 (0)