newline before JLine's above threshold prompt

This commit is contained in:
Mark Harrah 2011-03-25 18:22:30 -04:00
parent e498b9bd3a
commit 213d995bb5
1 changed files with 6 additions and 1 deletions

View File

@ -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 =