Skip to content

Commit

Permalink
hack around bug in TermCore for now that's causing overflow in REPL t…
Browse files Browse the repository at this point in the history
…o eat previous lines
  • Loading branch information
Li Haoyi committed Aug 5, 2015
1 parent 82466bf commit d809509
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions repl/src/main/scala/ammonite/repl/frontend/FrontEnd.scala
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,11 @@ object FrontEnd{
)
val newIndices = before ++ middle ++ after
val displayOffset = if (cursor < mark) 0 else -1
(Highlighter.flattenIndices(newIndices, buffer), cursor + displayOffset)
case _ => (Highlighter.flattenIndices(indices, buffer), cursor)
// Add Console.RESET to the end of the buffer to hack around bug
// in TermCore, to be fixed later when we clean up the crazy
// TermCore.readLine logic
(Highlighter.flattenIndices(newIndices, buffer) ++ Console.RESET, cursor + displayOffset)
case _ => (Highlighter.flattenIndices(indices, buffer) ++ Console.RESET, cursor)
}
}
)
Expand Down

0 comments on commit d809509

Please sign in to comment.