MCPcopy Index your code
hub / github.com/DHTMLX/gantt / findViewIndex

Function findViewIndex

samples/common/codehighlight/codemirror.js:2975–2984  ·  view source on GitHub ↗
(cm, n)

Source from the content-addressed store, hash-verified

2973 // Find the view element corresponding to a given line. Return null
2974 // when the line isn't visible.
2975 function findViewIndex(cm, n) {
2976 if (n >= cm.display.viewTo) { return null }
2977 n -= cm.display.viewFrom;
2978 if (n < 0) { return null }
2979 var view = cm.display.view;
2980 for (var i = 0; i < view.length; i++) {
2981 n -= view[i].size;
2982 if (n < 0) { return i }
2983 }
2984 }
2985
2986 // Updates the display.view data structure for a given change to the
2987 // document. From and to are in pre-change coordinates. Lendiff is

Callers 5

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

Calls

no outgoing calls

Tested by

no test coverage detected