(lineObj)
| 1620 | |
| 1621 | // Find the height above the given line. |
| 1622 | function heightAtLine(lineObj) { |
| 1623 | lineObj = visualLine(lineObj); |
| 1624 | |
| 1625 | var h = 0, chunk = lineObj.parent; |
| 1626 | for (var i = 0; i < chunk.lines.length; ++i) { |
| 1627 | var line = chunk.lines[i]; |
| 1628 | if (line == lineObj) { break } |
| 1629 | else { h += line.height; } |
| 1630 | } |
| 1631 | for (var p = chunk.parent; p; chunk = p, p = chunk.parent) { |
| 1632 | for (var i$1 = 0; i$1 < p.children.length; ++i$1) { |
| 1633 | var cur = p.children[i$1]; |
| 1634 | if (cur == chunk) { break } |
| 1635 | else { h += cur.height; } |
| 1636 | } |
| 1637 | } |
| 1638 | return h |
| 1639 | } |
| 1640 | |
| 1641 | // Compute the character length of a line, taking into account |
| 1642 | // collapsed ranges (see markText) that might hide parts, and join |
no test coverage detected