MCPcopy Create free account
hub / github.com/TruthHun/BookStack / prepareMeasureForLine

Function prepareMeasureForLine

static/mergely/lib/codemirror.js:2602–2620  ·  view source on GitHub ↗
(cm, line)

Source from the content-addressed store, hash-verified

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

Callers 3

measureCharFunction · 0.70
cursorCoordsFunction · 0.70
coordsCharInnerFunction · 0.70

Calls 6

lineNoFunction · 0.70
findViewForLineFunction · 0.70
updateLineForChangesFunction · 0.70
getDimensionsFunction · 0.70
mapFromLineViewFunction · 0.70

Tested by

no test coverage detected