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