MCPcopy
hub / github.com/csev/py4e / prepareMeasureForLine

Function prepareMeasureForLine

tools/pythonauto/static/codemirrorepl/codemirror.js:1518–1534  ·  view source on GitHub ↗
(cm, line)

Source from the content-addressed store, hash-verified

1516 // measurements in a row, can thus ensure that the set-up work is
1517 // only done once.
1518 function prepareMeasureForLine(cm, line) {
1519 var lineN = lineNo(line);
1520 var view = findViewForLine(cm, lineN);
1521 if (view && !view.text)
1522 view = null;
1523 else if (view && view.changes)
1524 updateLineForChanges(cm, view, lineN, getDimensions(cm));
1525 if (!view)
1526 view = updateExternalMeasurement(cm, line);
1527
1528 var info = mapFromLineView(view, line, lineN);
1529 return {
1530 line: line, view: view, rect: null,
1531 map: info.map, cache: info.cache, before: info.before,
1532 hasHeights: false
1533 };
1534 }
1535
1536 // Given a prepared measurement object, measures the position of an
1537 // actual character (or fetches it from the cache).

Callers 3

measureCharFunction · 0.85
cursorCoordsFunction · 0.85
coordsCharInnerFunction · 0.85

Calls 6

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

Tested by

no test coverage detected