@@ -24,8 +24,9 @@ import dotc.transform.ValueClasses
2424 * `ReplDriver#resetToInitial` is called, the accompanying instance of
2525 * `Rendering` is no longer valid.
2626 */
27- private [repl] class Rendering (parentClassLoader : Option [ClassLoader ] = None ,
28- maxPrintElements : Int = 1000 ):
27+ private [repl] class Rendering (parentClassLoader : Option [ClassLoader ] = None ):
28+ // val maxPrintElements: Int = 1000
29+ // rootCtx.settings.VreplMaxPrintElements.valueIn(rootCtx.settingsState)
2930
3031 import Rendering ._
3132
@@ -34,7 +35,7 @@ private[repl] class Rendering(parentClassLoader: Option[ClassLoader] = None,
3435 private var myReplStringOf : Object => String = _
3536
3637 /** Class loader used to load compiled code */
37- private [repl] def classLoader ()(using Context ) =
38+ private [repl] def classLoader ()(using ctx : Context ) =
3839 if (myClassLoader != null && myClassLoader.root == ctx.settings.outputDir.value) myClassLoader
3940 else {
4041 val parent = Option (myClassLoader).orElse(parentClassLoader).getOrElse {
@@ -50,6 +51,7 @@ private[repl] class Rendering(parentClassLoader: Option[ClassLoader] = None,
5051 }
5152
5253 myClassLoader = new AbstractFileClassLoader (ctx.settings.outputDir.value, parent)
54+ val maxPrintElements = ctx.settings.VreplMaxPrintElements .valueIn(ctx.settingsState)
5355 myReplStringOf = {
5456 // We need to use the ScalaRunTime class coming from the scala-library
5557 // on the user classpath, and not the one available in the current
@@ -79,7 +81,8 @@ private[repl] class Rendering(parentClassLoader: Option[ClassLoader] = None,
7981 * then this bug will surface, so perhaps better not?
8082 * https://github.com/scala/bug/issues/12337
8183 */
82- private [repl] def truncate (str : String ): String =
84+ private [repl] def truncate (str : String )(using ctx : Context ): String =
85+ val maxPrintElements = ctx.settings.VreplMaxPrintElements .valueIn(ctx.settingsState)
8386 val showTruncated = " ... large output truncated, print value to show all"
8487 val ncp = str.codePointCount(0 , str.length) // to not cut inside code point
8588 if ncp <= maxPrintElements then str
0 commit comments