(cm, n)
| 914 | } |
| 915 | |
| 916 | function getStateBefore(cm, n) { |
| 917 | var doc = cm.doc, display = cm.display; |
| 918 | if (!doc.mode.startState) return true; |
| 919 | var pos = findStartLine(cm, n), state = pos > doc.first && getLine(doc, pos-1).stateAfter; |
| 920 | if (!state) state = startState(doc.mode); |
| 921 | else state = copyState(doc.mode, state); |
| 922 | doc.iter(pos, n, function(line) { |
| 923 | processLine(cm, line, state); |
| 924 | var save = pos == n - 1 || pos % 5 == 0 || pos >= display.showingFrom && pos < display.showingTo; |
| 925 | line.stateAfter = save ? copyState(doc.mode, state) : null; |
| 926 | ++pos; |
| 927 | }); |
| 928 | return state; |
| 929 | } |
| 930 | |
| 931 | // POSITION MEASUREMENT |
| 932 |
no test coverage detected