From 213d995bb5d39b3c12d63cdf28095e6735a00ea9 Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Fri, 25 Mar 2011 18:22:30 -0400 Subject: [PATCH] newline before JLine's above threshold prompt --- util/complete/JLineCompletion.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/util/complete/JLineCompletion.scala b/util/complete/JLineCompletion.scala index c6fd26433..18fc11fa4 100644 --- a/util/complete/JLineCompletion.scala +++ b/util/complete/JLineCompletion.scala @@ -98,7 +98,12 @@ object JLineCompletion reader.drawLine() } def printCompletions(cs: Seq[String], reader: ConsoleReader): Unit = - if(cs.isEmpty) () else CandidateListCompletionHandler.printCandidates(reader, JavaConversions.asJavaList(cs), true) + { + // CandidateListCompletionHandler doesn't print a new line before the prompt + if(cs.size > reader.getAutoprintThreshhold) + reader.printNewline() + CandidateListCompletionHandler.printCandidates(reader, JavaConversions.asJavaList(cs), true) + } def commonPrefix(s: Seq[String]): String = if(s.isEmpty) "" else s reduceLeft commonPrefix def commonPrefix(a: String, b: String): String =