From 9c8cf4451d7dcba5417f2f3dd24ea9f6fe392dfd Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Wed, 4 Aug 2010 19:48:48 -0400 Subject: [PATCH] remove call-by-name modifier for error function, doesn't work well --- util/complete/History.scala | 4 ++-- util/complete/HistoryCommands.scala | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/util/complete/History.scala b/util/complete/History.scala index bf009f626..e792454f7 100644 --- a/util/complete/History.scala +++ b/util/complete/History.scala @@ -6,7 +6,7 @@ package complete import History.number -final class History private(lines: IndexedSeq[String], error: (=> String) => Unit) extends NotNull +final class History private(lines: IndexedSeq[String], error: String => Unit) extends NotNull { private def reversed = lines.reverse @@ -41,7 +41,7 @@ final class History private(lines: IndexedSeq[String], error: (=> String) => Uni object History { - def apply(lines: Seq[String], error: (=> String) => Unit): History = new History(lines.toIndexedSeq, error) + def apply(lines: Seq[String], error: String => Unit): History = new History(lines.toIndexedSeq, error) def number(s: String): Option[Int] = try { Some(s.toInt) } diff --git a/util/complete/HistoryCommands.scala b/util/complete/HistoryCommands.scala index a03c9cfca..a5b321d8c 100644 --- a/util/complete/HistoryCommands.scala +++ b/util/complete/HistoryCommands.scala @@ -38,7 +38,7 @@ object HistoryCommands def printHelp(): Unit = println(helpString) - def apply(s: String, historyPath: Option[Path], maxLines: Int, error: (=> String) => Unit): Option[List[String]] = + def apply(s: String, historyPath: Option[Path], maxLines: Int, error: String => Unit): Option[List[String]] = if(s.isEmpty) { printHelp()