(cm, line)
| 3655 | // measurements in a row, can thus ensure that the set-up work is |
| 3656 | // only done once. |
| 3657 | function prepareMeasureForLine(cm, line) { |
| 3658 | var lineN = lineNo(line) |
| 3659 | var view = findViewForLine(cm, lineN) |
| 3660 | if (view && !view.text) { |
| 3661 | view = null |
| 3662 | } else if (view && view.changes) { |
| 3663 | updateLineForChanges(cm, view, lineN, getDimensions(cm)) |
| 3664 | cm.curOp.forceUpdate = true |
| 3665 | } |
| 3666 | if (!view) { |
| 3667 | view = updateExternalMeasurement(cm, line) |
| 3668 | } |
| 3669 | |
| 3670 | var info = mapFromLineView(view, line, lineN) |
| 3671 | return { |
| 3672 | line: line, |
| 3673 | view: view, |
| 3674 | rect: null, |
| 3675 | map: info.map, |
| 3676 | cache: info.cache, |
| 3677 | before: info.before, |
| 3678 | hasHeights: false |
| 3679 | } |
| 3680 | } |
| 3681 | |
| 3682 | // Given a prepared measurement object, measures the position of an |
| 3683 | // actual character (or fetches it from the cache). |
no test coverage detected