From c345782c06429c13b6303c903736df7f1949d056 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Fri, 1 Apr 2011 23:55:01 +0000 Subject: A double completion whammy: crasher for edge co... A double completion whammy: crasher for edge condition and method signatures not being cleaned of their $iws. Closes #4434, no review. --- src/compiler/scala/tools/nsc/interpreter/ConsoleReaderHelper.scala | 3 ++- src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/compiler/scala/tools/nsc/interpreter/ConsoleReaderHelper.scala b/src/compiler/scala/tools/nsc/interpreter/ConsoleReaderHelper.scala index a775fca92c..cfe932ad0b 100644 --- a/src/compiler/scala/tools/nsc/interpreter/ConsoleReaderHelper.scala +++ b/src/compiler/scala/tools/nsc/interpreter/ConsoleReaderHelper.scala @@ -55,8 +55,9 @@ trait ConsoleReaderHelper extends ConsoleReader { var linesLeft = if (isPaginationEnabled()) height - 1 else Int.MaxValue val columnSize = longest + marginSize val padded = items map ("%-" + columnSize + "s" format _) + val groupSize = 1 max (width / columnSize) // make sure it doesn't divide to 0 - padded grouped (width / columnSize) foreach { xs => + padded grouped groupSize foreach { xs => println(xs.mkString) linesLeft -= 1 if (linesLeft <= 0) { diff --git a/src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala b/src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala index 7430406306..b7baea57fc 100644 --- a/src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala +++ b/src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala @@ -102,7 +102,9 @@ class JLineCompletion(val intp: IMain) extends Completion with CompletionOutput def excludeStartsWith: List[String] = List("<") // , , etc. def excludeNames: List[String] = (anyref.methodNames filterNot anyRefMethodsToShow) :+ "_root_" - def methodSignatureString(sym: Symbol) = afterTyper(new MethodSymbolOutput(sym).methodString()) + def methodSignatureString(sym: Symbol) = { + IMain stripString afterTyper(new MethodSymbolOutput(sym).methodString()) + } def exclude(name: String): Boolean = ( (name contains "$") || -- cgit v1.2.3