MCPcopy Create free account
hub / github.com/TruthHun/BookStack / findViewForLine

Function findViewForLine

static/editor.md/lib/codemirror/lib/codemirror.js:2485–2491  ·  view source on GitHub ↗
(cm, lineN)

Source from the content-addressed store, hash-verified

2483
2484 // Find a line view that corresponds to the given line number.
2485 function findViewForLine(cm, lineN) {
2486 if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)
2487 return cm.display.view[findViewIndex(cm, lineN)];
2488 var ext = cm.display.externalMeasured;
2489 if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)
2490 return ext;
2491 }
2492
2493 // Measurement can be split in two steps, the set-up work that
2494 // applies to the whole line, and the measurement of the actual

Callers 3

posToDOMFunction · 0.70
prepareMeasureForLineFunction · 0.70
codemirror.jsFile · 0.70

Calls 1

findViewIndexFunction · 0.70

Tested by

no test coverage detected