summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-04-01 23:55:01 +0000
committerPaul Phillips <paulp@improving.org>2011-04-01 23:55:01 +0000
commitc345782c06429c13b6303c903736df7f1949d056 (patch)
treeab69ff146dc1041652e88f4fd063e13022fba3bd /src/compiler
parent223428d1ebd13ddc96b7599db18d756efa532228 (diff)
downloadscala-c345782c06429c13b6303c903736df7f1949d056.tar.gz
scala-c345782c06429c13b6303c903736df7f1949d056.tar.bz2
scala-c345782c06429c13b6303c903736df7f1949d056.zip
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.
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/interpreter/ConsoleReaderHelper.scala3
-rw-r--r--src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala4
2 files changed, 5 insertions, 2 deletions
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("<") // <byname>, <repeated>, 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 "$") ||