(cm, line)
| 2395 | // measurements in a row, can thus ensure that the set-up work is |
| 2396 | // only done once. |
| 2397 | function prepareMeasureForLine(cm, line) { |
| 2398 | var lineN = lineNo(line); |
| 2399 | var view = findViewForLine(cm, lineN); |
| 2400 | if (view && !view.text) { |
| 2401 | view = null; |
| 2402 | } else if (view && view.changes) { |
| 2403 | updateLineForChanges(cm, view, lineN, getDimensions(cm)); |
| 2404 | cm.curOp.forceUpdate = true; |
| 2405 | } |
| 2406 | if (!view) |
| 2407 | { view = updateExternalMeasurement(cm, line); } |
| 2408 | |
| 2409 | var info = mapFromLineView(view, line, lineN); |
| 2410 | return { |
| 2411 | line: line, view: view, rect: null, |
| 2412 | map: info.map, cache: info.cache, before: info.before, |
| 2413 | hasHeights: false |
| 2414 | } |
| 2415 | } |
| 2416 | |
| 2417 | // Given a prepared measurement object, measures the position of an |
| 2418 | // actual character (or fetches it from the cache). |
no test coverage detected