MCPcopy Create free account
hub / github.com/breck7/scroll / findViewForLine

Function findViewForLine

external/.scrollLibs.js:3642–3650  ·  view source on GitHub ↗
(cm, lineN)

Source from the content-addressed store, hash-verified

3640
3641 // Find a line view that corresponds to the given line number.
3642 function findViewForLine(cm, lineN) {
3643 if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo) {
3644 return cm.display.view[findViewIndex(cm, lineN)]
3645 }
3646 var ext = cm.display.externalMeasured
3647 if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size) {
3648 return ext
3649 }
3650 }
3651
3652 // Measurement can be split in two steps, the set-up work that
3653 // applies to the whole line, and the measurement of the actual

Callers 3

prepareMeasureForLineFunction · 0.85
.scrollLibs.jsFile · 0.85
posToDOMFunction · 0.85

Calls 1

findViewIndexFunction · 0.85

Tested by

no test coverage detected