diff options
author | Adriaan Moors <adriaan@lightbend.com> | 2017-02-21 11:57:05 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-21 11:57:05 -0800 |
commit | d60f6e340766f8876adb21092081bf264c64597f (patch) | |
tree | c465fa15a9e1d6207c45107b318818aa84b6ea50 /src/repl/scala/tools/nsc/interpreter/IMain.scala | |
parent | a8c4a54d18c5560417d8c41db8b23a10fe8d616d (diff) | |
download | scala-d60f6e340766f8876adb21092081bf264c64597f.tar.gz scala-d60f6e340766f8876adb21092081bf264c64597f.tar.bz2 scala-d60f6e340766f8876adb21092081bf264c64597f.zip |
Revert "SI-10133 Require escaped single quote char lit"
Diffstat (limited to 'src/repl/scala/tools/nsc/interpreter/IMain.scala')
-rw-r--r-- | src/repl/scala/tools/nsc/interpreter/IMain.scala | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/repl/scala/tools/nsc/interpreter/IMain.scala b/src/repl/scala/tools/nsc/interpreter/IMain.scala index 2ae3b207b7..a351d2da95 100644 --- a/src/repl/scala/tools/nsc/interpreter/IMain.scala +++ b/src/repl/scala/tools/nsc/interpreter/IMain.scala @@ -111,8 +111,11 @@ class IMain(initialSettings: Settings, protected val out: JPrintWriter) extends try body finally label = saved } + // the expanded prompt but without color escapes and without leading newline, for purposes of indenting + lazy val formatting = Formatting.forPrompt(replProps.promptText) lazy val reporter: ReplReporter = new ReplReporter(this) + import formatting.indentCode import reporter.{ printMessage, printUntruncatedMessage } // This exists mostly because using the reporter too early leads to deadlock. @@ -864,8 +867,8 @@ class IMain(initialSettings: Settings, protected val out: JPrintWriter) extends |${preambleHeader format lineRep.readName} |${envLines mkString (" ", ";\n ", ";\n")} |$importsPreamble - |${toCompute}""".stripMargin - def preambleLength = preamble.length - toCompute.length + |${indentCode(toCompute)}""".stripMargin + def preambleLength = preamble.length - toCompute.length - 1 val generate = (m: MemberHandler) => m extraCodeToEvaluate Request.this |