(cm, n, precise)
| 2390 | } |
| 2391 | |
| 2392 | function getStateBefore(cm, n, precise) { |
| 2393 | var doc = cm.doc, display = cm.display; |
| 2394 | if (!doc.mode.startState) return true; |
| 2395 | var pos = findStartLine(cm, n, precise), state = pos > doc.first && getLine(doc, pos-1).stateAfter; |
| 2396 | if (!state) state = startState(doc.mode); |
| 2397 | else state = copyState(doc.mode, state); |
| 2398 | doc.iter(pos, n, function(line) { |
| 2399 | processLine(cm, line.text, state); |
| 2400 | var save = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo; |
| 2401 | line.stateAfter = save ? copyState(doc.mode, state) : null; |
| 2402 | ++pos; |
| 2403 | }); |
| 2404 | if (precise) doc.frontier = pos; |
| 2405 | return state; |
| 2406 | } |
| 2407 | |
| 2408 | // POSITION MEASUREMENT |
| 2409 |
no test coverage detected
searching dependent graphs…