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