MCPcopy
hub / github.com/DHTMLX/gantt / mapFromLineView

Function mapFromLineView

samples/common/codehighlight/codemirror.js:2343–2352  ·  view source on GitHub ↗
(lineView, line, lineN)

Source from the content-addressed store, hash-verified

2341 // measurement cache for the given line number. (A line view might
2342 // contain multiple lines when collapsed ranges are present.)
2343 function mapFromLineView(lineView, line, lineN) {
2344 if (lineView.line == line)
2345 { return {map: lineView.measure.map, cache: lineView.measure.cache} }
2346 for (var i = 0; i < lineView.rest.length; i++)
2347 { if (lineView.rest[i] == line)
2348 { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }
2349 for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)
2350 { if (lineNo(lineView.rest[i$1]) > lineN)
2351 { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }
2352 }
2353
2354 // Render a line into the hidden node display.externalMeasured. Used
2355 // when measurement is needed for a line that's not in the viewport.

Callers 2

prepareMeasureForLineFunction · 0.85
posToDOMFunction · 0.85

Calls 1

lineNoFunction · 0.85

Tested by

no test coverage detected