(cm, n)
| 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; |
no outgoing calls
no test coverage detected