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