(cm, line)
| 2608 | // measurements in a row, can thus ensure that the set-up work is |
| 2609 | // only done once. |
| 2610 | function prepareMeasureForLine(cm, line) { |
| 2611 | var lineN = lineNo(line); |
| 2612 | var view = findViewForLine(cm, lineN); |
| 2613 | if (view && !view.text) { |
| 2614 | view = null; |
| 2615 | } else if (view && view.changes) { |
| 2616 | updateLineForChanges(cm, view, lineN, getDimensions(cm)); |
| 2617 | cm.curOp.forceUpdate = true; |
| 2618 | } |
| 2619 | if (!view) |
| 2620 | view = updateExternalMeasurement(cm, line); |
| 2621 | |
| 2622 | var info = mapFromLineView(view, line, lineN); |
| 2623 | return { |
| 2624 | line: line, view: view, rect: null, |
| 2625 | map: info.map, cache: info.cache, before: info.before, |
| 2626 | hasHeights: false |
| 2627 | }; |
| 2628 | } |
| 2629 | |
| 2630 | // Given a prepared measurement object, measures the position of an |
| 2631 | // actual character (or fetches it from the cache). |
no test coverage detected