summaryrefslogtreecommitdiff
path: root/src/repl/scala/tools/nsc/interpreter/session/History.scala
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2015-06-12 15:19:00 +0200
committerAdriaan Moors <adriaan.moors@typesafe.com>2015-06-17 13:36:55 -0700
commit43139faa4f4348b95907e06883f2fefb41ea3a3b (patch)
treeeadd8bf7ade4948c0d989b7f5038b8824eb43152 /src/repl/scala/tools/nsc/interpreter/session/History.scala
parent43a56fb5a1b6450ce2bdf8f73ab30ca1b16d0778 (diff)
downloadscala-43139faa4f4348b95907e06883f2fefb41ea3a3b.tar.gz
scala-43139faa4f4348b95907e06883f2fefb41ea3a3b.tar.bz2
scala-43139faa4f4348b95907e06883f2fefb41ea3a3b.zip
Centralize dependencies on jline
Code that depends on jline is now in package `scala.tools.nsc.interpreter.jline`. To make this possible, remove the `entries` functionality from `History`, and add the `historicize` method. Also provide an overload for `asStrings`. Clean up a little along the way in `JLineHistory.scala` and `JLineReader.scala`. Next step: fall back to an embedded jline when the expected jline jar is not on the classpath. The gist of the refactor: https://gist.github.com/adriaanm/02e110d4da0a585480c1
Diffstat (limited to 'src/repl/scala/tools/nsc/interpreter/session/History.scala')
-rw-r--r--src/repl/scala/tools/nsc/interpreter/session/History.scala3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/repl/scala/tools/nsc/interpreter/session/History.scala b/src/repl/scala/tools/nsc/interpreter/session/History.scala
index 794d41adc7..2028a13dfd 100644
--- a/src/repl/scala/tools/nsc/interpreter/session/History.scala
+++ b/src/repl/scala/tools/nsc/interpreter/session/History.scala
@@ -11,7 +11,10 @@ package session
* reference to the jline classes. Very sparse right now.
*/
trait History {
+ def historicize(text: String): Boolean = false
+
def asStrings: List[String]
+ def asStrings(from: Int, to: Int): List[String] = asStrings.slice(from, to)
def index: Int
def size: Int
}