MCPcopy Index your code
hub / github.com/witheve/Eve / prepareMeasureForLine

Function prepareMeasureForLine

src/codemirror.js:2610–2628  ·  view source on GitHub ↗
(cm, line)

Source from the content-addressed store, hash-verified

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).

Callers 3

measureCharFunction · 0.85
cursorCoordsFunction · 0.85
coordsCharInnerFunction · 0.85

Calls 6

lineNoFunction · 0.85
findViewForLineFunction · 0.85
updateLineForChangesFunction · 0.85
getDimensionsFunction · 0.85
mapFromLineViewFunction · 0.85

Tested by

no test coverage detected