MCPcopy
hub / github.com/witheve/Eve / findViewIndex

Function findViewIndex

src/codemirror.js:3349–3358  ·  view source on GitHub ↗
(cm, n)

Source from the content-addressed store, hash-verified

3347 // Find the view element corresponding to a given line. Return null
3348 // when the line isn't visible.
3349 function findViewIndex(cm, n) {
3350 if (n >= cm.display.viewTo) return null;
3351 n -= cm.display.viewFrom;
3352 if (n < 0) return null;
3353 var view = cm.display.view;
3354 for (var i = 0; i < view.length; i++) {
3355 n -= view[i].size;
3356 if (n < 0) return i;
3357 }
3358 }
3359
3360 function viewCuttingPoint(cm, oldN, newN, dir) {
3361 var index = findViewIndex(cm, oldN), diff, view = cm.display.view;

Callers 5

codemirror.jsFile · 0.85
findViewForLineFunction · 0.85
regLineChangeFunction · 0.85
viewCuttingPointFunction · 0.85
adjustViewFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected