MCPcopy Create free account
hub / github.com/sql-js/sql.js / mapFromLineView

Function mapFromLineView

GUI/codemirror/lib/codemirror.js:1490–1499  ·  view source on GitHub ↗
(lineView, line, lineN)

Source from the content-addressed store, hash-verified

1488 // measurement cache for the given line number. (A line view might
1489 // contain multiple lines when collapsed ranges are present.)
1490 function mapFromLineView(lineView, line, lineN) {
1491 if (lineView.line == line)
1492 return {map: lineView.measure.map, cache: lineView.measure.cache};
1493 for (var i = 0; i < lineView.rest.length; i++)
1494 if (lineView.rest[i] == line)
1495 return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]};
1496 for (var i = 0; i < lineView.rest.length; i++)
1497 if (lineNo(lineView.rest[i]) > lineN)
1498 return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i], before: true};
1499 }
1500
1501 // Render a line into the hidden node display.externalMeasured. Used
1502 // when measurement is needed for a line that's not in the viewport.

Callers 1

prepareMeasureForLineFunction · 0.85

Calls 1

lineNoFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…