Permalink
Browse files

SI-4714 Initialize history while initializing the REPL's reader

It was possible to get a command into the REPL before the history
recording object was set and so the command would be lost in the sands
of time. This fix just moves the initialization of the history object
into the JLineReader constructor, out of the post-init hook.
  • Loading branch information...
1 parent d672102 commit 5f85fe52d45199e3bf9a130b3fe91e3b44f8bd88 @JamesIry JamesIry committed Feb 1, 2013
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/compiler/scala/tools/nsc/interpreter/JLineReader.scala
@@ -37,6 +37,9 @@ class JLineReader(_completion: => Completion) extends InteractiveReader {
}
class JLineConsoleReader extends ConsoleReader with ConsoleReaderHelper {
+ if ((history: History) ne NoHistory)
+ this setHistory history
+
// working around protected/trait/java insufficiencies.
def goBack(num: Int): Unit = back(num)
def readOneKey(prompt: String) = {
@@ -51,8 +54,6 @@ class JLineReader(_completion: => Completion) extends InteractiveReader {
// A hook for running code after the repl is done initializing.
lazy val postInit: Unit = {
this setBellEnabled false
- if ((history: History) ne NoHistory)
- this setHistory history
if (completion ne NoCompletion) {
val argCompletor: ArgumentCompleter =

0 comments on commit 5f85fe5

Please sign in to comment.