Skip to content

Commit

Permalink
fix autocomplete
Browse files Browse the repository at this point in the history
  • Loading branch information
Li Haoyi committed Jun 6, 2016
1 parent 97aaae3 commit 115d242
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions readme/Footer.scalatex
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
Made @sect.ref{browse} use the process current working directory if there's no implicit path in scope, since most times it doesn't matter
@li
Make the welcome banner "Welcome to the Ammonite Repl..." customizable
@li
Fixed bug where triggering autocomplete resulted in a broken REPL session
@sect{0.5.9}
@ul
@li
Expand Down
7 changes: 6 additions & 1 deletion repl/src/main/scala/ammonite/repl/interp/Interpreter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,10 @@ class Interpreter(prompt0: Ref[String],
def evalClassloader = eval.sess.frames.head.classloader
def init() = {
Timer("Interpreter init init 0")
// Note we not only make a copy of `settings` to pass to the compiler,
// we also make a *separate* copy to pass to the presentation compiler.
// Otherwise activating autocomplete makes the presentation compiler mangle
// the shared settings and makes the main compiler sad
val settings = Option(compiler).fold(new Settings)(_.compiler.settings.copy)
compiler = Compiler(
Classpath.classpath ++ eval.sess.frames.head.classpath,
Expand All @@ -459,7 +463,8 @@ class Interpreter(prompt0: Ref[String],
Classpath.classpath ++ eval.sess.frames.head.classpath,
dynamicClasspath,
evalClassloader,
settings

settings.copy()
)
Timer("Interpreter init init pressy")
}
Expand Down

0 comments on commit 115d242

Please sign in to comment.