mirror of https://github.com/sbt/sbt.git
prevent another StringIndexOutOfBoundsException in Graph.toAscii
This commit is contained in:
parent
f5a6aa42b1
commit
701206b54d
|
|
@ -63,12 +63,14 @@ object Graph
|
|||
if (s.length > maxColumn) s.slice(0, maxColumn - 2) + ".."
|
||||
else s
|
||||
def insertBar(s: String, at: Int): String =
|
||||
s.slice(0, at) +
|
||||
(s(at).toString match {
|
||||
case " " => "|"
|
||||
case x => x
|
||||
}) +
|
||||
s.slice(at + 1, s.length)
|
||||
if (at < s.length)
|
||||
s.slice(0, at) +
|
||||
(s(at).toString match {
|
||||
case " " => "|"
|
||||
case x => x
|
||||
}) +
|
||||
s.slice(at + 1, s.length)
|
||||
else s
|
||||
def toAsciiLines(node: A, level: Int): Vector[String] = {
|
||||
val line = limitLine((twoSpaces * level) + (if (level == 0) "" else "+-") + display(node))
|
||||
val cs = Vector(children(node): _*)
|
||||
|
|
|
|||
Loading…
Reference in New Issue