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

Function mapFromLineView

tools/pythonauto/static/codemirrorepl/codemirror.js:1474–1483  ·  view source on GitHub ↗
(lineView, line, lineN)

Source from the content-addressed store, hash-verified

1472 // measurement cache for the given line number. (A line view might
1473 // contain multiple lines when collapsed ranges are present.)
1474 function mapFromLineView(lineView, line, lineN) {
1475 if (lineView.line == line)
1476 return {map: lineView.measure.map, cache: lineView.measure.cache};
1477 for (var i = 0; i < lineView.rest.length; i++)
1478 if (lineView.rest[i] == line)
1479 return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]};
1480 for (var i = 0; i < lineView.rest.length; i++)
1481 if (lineNo(lineView.rest[i]) > lineN)
1482 return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i], before: true};
1483 }
1484
1485 // Render a line into the hidden node display.externalMeasured. Used
1486 // when measurement is needed for a line that's not in the viewport.

Callers 1

prepareMeasureForLineFunction · 0.85

Calls 1

lineNoFunction · 0.70

Tested by

no test coverage detected