Skip to content

Commit 389c361

Browse files
committed
Fix :... commands printing erroneous messages on next newline
1 parent 1adef56 commit 389c361

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/dotty/tools/dotc/repl/InterpreterLoop.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ class InterpreterLoop(compiler: Compiler, config: REPL.Config)(implicit ctx: Con
148148
val quitRegexp = ":q(u(i(t)?)?)?"
149149
val loadRegexp = ":l(o(a(d)?)?)?.*"
150150
val replayRegexp = ":r(e(p(l(a(y)?)?)?)?)?.*"
151+
val lastOutput = interpreter.lastOutput()
151152

152153
var shouldReplay: Option[String] = None
153154

@@ -166,7 +167,7 @@ class InterpreterLoop(compiler: Compiler, config: REPL.Config)(implicit ctx: Con
166167
else if (line startsWith ":")
167168
output.println("Unknown command. Type :help for help.")
168169
else
169-
shouldReplay = interpreter.lastOutput() match { // don't interpret twice
170+
shouldReplay = lastOutput match { // don't interpret twice
170171
case Nil => interpretStartingWith(line)
171172
case oldRes =>
172173
oldRes foreach output.print

src/dotty/tools/dotc/repl/ammonite/SpecialKeys.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ package ammonite.terminal
99
*/
1010
object SpecialKeys {
1111

12-
1312
/**
1413
* Lets you easily pattern match on characters modified by ctrl,
1514
* or convert a character into its ctrl-ed version

0 commit comments

Comments
 (0)