Permalink
Browse files

REPL bells and whistles: -Dscala.repl.maxprintstring=<Integer>

Makes `maxPrintString` configurable and fixes its treatment at zero.
Quite useful for debugging elaborate classloaders with long classpaths.
  • Loading branch information...
xeno-by committed Jun 5, 2012
1 parent 2aaccfe commit c74533ad6547befcfaf524dcb93c920f922c47e1
@@ -1228,7 +1228,7 @@ object IMain {
def maxStringLength: Int
def isTruncating: Boolean
def truncate(str: String): String = {
if (isTruncating && str.length > maxStringLength)
if (isTruncating && (maxStringLength != 0 && str.length > maxStringLength))
(str take maxStringLength - 3) + "..."
else str
}
@@ -24,7 +24,7 @@ class ISettings(intp: IMain) {
* more than this number of characters, then the printout is
* truncated.
*/
var maxPrintString = 800
var maxPrintString = replProps.maxPrintString.option.getOrElse(800)
/** The maximum number of completion candidates to print for tab
* completion without requiring confirmation.
@@ -7,9 +7,11 @@ package scala.tools.nsc
package interpreter
import scala.sys._
import Prop._
class ReplProps {
private def bool(name: String) = BooleanProp.keyExists(name)
private def int(name: String) = IntProp(name)
val jlineDebug = bool("scala.tools.jline.internal.Log.debug")
val jlineTrace = bool("scala.tools.jline.internal.Log.trace")
@@ -25,4 +27,5 @@ class ReplProps {
val powerBanner = Prop[JFile]("scala.repl.power.banner")
val vids = bool("scala.repl.vids")
val maxPrintString = int("scala.repl.maxprintstring")
}

0 comments on commit c74533a

Please sign in to comment.