(cm, n)
| 3326 | // Find the view element corresponding to a given line. Return null |
| 3327 | // when the line isn't visible. |
| 3328 | function findViewIndex(cm, n) { |
| 3329 | if (n >= cm.display.viewTo) return null; |
| 3330 | n -= cm.display.viewFrom; |
| 3331 | if (n < 0) return null; |
| 3332 | var view = cm.display.view; |
| 3333 | for (var i = 0; i < view.length; i++) { |
| 3334 | n -= view[i].size; |
| 3335 | if (n < 0) return i; |
| 3336 | } |
| 3337 | } |
| 3338 | |
| 3339 | function viewCuttingPoint(cm, oldN, newN, dir) { |
| 3340 | var index = findViewIndex(cm, oldN), diff, view = cm.display.view; |
no outgoing calls
no test coverage detected