From 947b5757a976421f3dd8e8d04fe8baf91d1aad3f Mon Sep 17 00:00:00 2001 From: Allan Renucci Date: Mon, 9 Oct 2017 14:31:59 +0200 Subject: [PATCH] Prints new line when exiting the REPL Before: ```scala > repl scala> :quit [success] Total time: 8 s, completed Oct 9, 2017 2:31:06 PM > repl scala> ctrl-d [success] Total time: 7 s, completed Oct 9, 2017 2:31:18 PM ``` Now: ```scala > repl scala> :quit [success] Total time: 8 s, completed Oct 9, 2017 2:30:41 PM > repl scala> ctrl-d [success] Total time: 4 s, completed Oct 9, 2017 2:30:48 PM ``` --- compiler/src/dotty/tools/repl/ReplDriver.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/src/dotty/tools/repl/ReplDriver.scala b/compiler/src/dotty/tools/repl/ReplDriver.scala index b2f0f834434a..138f5b032f7c 100644 --- a/compiler/src/dotty/tools/repl/ReplDriver.scala +++ b/compiler/src/dotty/tools/repl/ReplDriver.scala @@ -132,7 +132,10 @@ class ReplDriver(settings: Array[String], @tailrec final def runUntilQuit(state: State = initState): State = { val res = readLine()(state) - if (res == Quit) state + if (res == Quit) { + out.println() + state + } else { // readLine potentially destroys the run, so a new one is needed for the // rest of the interpretation: