MCPcopy Index your code
hub / github.com/csev/py4e / findViewIndex

Function findViewIndex

tools/pythonauto/static/codemirrorepl/codemirror.js:2111–2120  ·  view source on GitHub ↗
(cm, n)

Source from the content-addressed store, hash-verified

2109 // Find the view element corresponding to a given line. Return null
2110 // when the line isn't visible.
2111 function findViewIndex(cm, n) {
2112 if (n >= cm.display.viewTo) return null;
2113 n -= cm.display.viewFrom;
2114 if (n < 0) return null;
2115 var view = cm.display.view;
2116 for (var i = 0; i < view.length; i++) {
2117 n -= view[i].size;
2118 if (n < 0) return i;
2119 }
2120 }
2121
2122 function viewCuttingPoint(cm, oldN, newN, dir) {
2123 var index = findViewIndex(cm, oldN), diff, view = cm.display.view;

Callers 4

findViewForLineFunction · 0.85
regLineChangeFunction · 0.85
viewCuttingPointFunction · 0.85
adjustViewFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected