(line)
| 1617 | // collapsed ranges (see markText) that might hide parts, and join |
| 1618 | // other lines onto it. |
| 1619 | function lineLength(line) { |
| 1620 | if (line.height == 0) { |
| 1621 | return 0 |
| 1622 | } |
| 1623 | var len = line.text.length, |
| 1624 | merged, |
| 1625 | cur = line |
| 1626 | while ((merged = collapsedSpanAtStart(cur))) { |
| 1627 | var found = merged.find(0, true) |
| 1628 | cur = found.from.line |
| 1629 | len += found.from.ch - found.to.ch |
| 1630 | } |
| 1631 | cur = line |
| 1632 | while ((merged = collapsedSpanAtEnd(cur))) { |
| 1633 | var found$1 = merged.find(0, true) |
| 1634 | len -= cur.text.length - found$1.from.ch |
| 1635 | cur = found$1.to.line |
| 1636 | len += cur.text.length - found$1.to.ch |
| 1637 | } |
| 1638 | return len |
| 1639 | } |
| 1640 | |
| 1641 | // Find the longest line in the document. |
| 1642 | function findMaxLine(cm) { |
no test coverage detected