(cm, n)
| 3217 | // Find the view element corresponding to a given line. Return null |
| 3218 | // when the line isn't visible. |
| 3219 | function findViewIndex(cm, n) { |
| 3220 | if (n >= cm.display.viewTo) return null; |
| 3221 | n -= cm.display.viewFrom; |
| 3222 | if (n < 0) return null; |
| 3223 | var view = cm.display.view; |
| 3224 | for (var i = 0; i < view.length; i++) { |
| 3225 | n -= view[i].size; |
| 3226 | if (n < 0) return i; |
| 3227 | } |
| 3228 | } |
| 3229 | |
| 3230 | function viewCuttingPoint(cm, oldN, newN, dir) { |
| 3231 | var index = findViewIndex(cm, oldN), diff, view = cm.display.view; |
no outgoing calls
no test coverage detected