(cm, n, precise)
| 967 | } |
| 968 | |
| 969 | function getStateBefore(cm, n, precise) { |
| 970 | var doc = cm.doc, display = cm.display; |
| 971 | if (!doc.mode.startState) return true; |
| 972 | var pos = findStartLine(cm, n, precise), state = pos > doc.first && getLine(doc, pos-1).stateAfter; |
| 973 | if (!state) state = startState(doc.mode); |
| 974 | else state = copyState(doc.mode, state); |
| 975 | doc.iter(pos, n, function(line) { |
| 976 | processLine(cm, line.text, state); |
| 977 | var save = pos == n - 1 || pos % 5 == 0 || pos >= display.showingFrom && pos < display.showingTo; |
| 978 | line.stateAfter = save ? copyState(doc.mode, state) : null; |
| 979 | ++pos; |
| 980 | }); |
| 981 | if (precise) doc.frontier = pos; |
| 982 | return state; |
| 983 | } |
| 984 | |
| 985 | // POSITION MEASUREMENT |
| 986 |
no test coverage detected