(lineObj)
| 1588 | |
| 1589 | // Find the height above the given line. |
| 1590 | function heightAtLine(lineObj) { |
| 1591 | lineObj = visualLine(lineObj) |
| 1592 | |
| 1593 | var h = 0, |
| 1594 | chunk = lineObj.parent |
| 1595 | for (var i = 0; i < chunk.lines.length; ++i) { |
| 1596 | var line = chunk.lines[i] |
| 1597 | if (line == lineObj) { |
| 1598 | break |
| 1599 | } else { |
| 1600 | h += line.height |
| 1601 | } |
| 1602 | } |
| 1603 | for (var p = chunk.parent; p; chunk = p, p = chunk.parent) { |
| 1604 | for (var i$1 = 0; i$1 < p.children.length; ++i$1) { |
| 1605 | var cur = p.children[i$1] |
| 1606 | if (cur == chunk) { |
| 1607 | break |
| 1608 | } else { |
| 1609 | h += cur.height |
| 1610 | } |
| 1611 | } |
| 1612 | } |
| 1613 | return h |
| 1614 | } |
| 1615 | |
| 1616 | // Compute the character length of a line, taking into account |
| 1617 | // collapsed ranges (see markText) that might hide parts, and join |
no test coverage detected