(cm, n, precise)
| 2502 | } |
| 2503 | |
| 2504 | function getStateBefore(cm, n, precise) { |
| 2505 | var doc = cm.doc, display = cm.display; |
| 2506 | if (!doc.mode.startState) return true; |
| 2507 | var pos = findStartLine(cm, n, precise), state = pos > doc.first && getLine(doc, pos-1).stateAfter; |
| 2508 | if (!state) state = startState(doc.mode); |
| 2509 | else state = copyState(doc.mode, state); |
| 2510 | doc.iter(pos, n, function(line) { |
| 2511 | processLine(cm, line.text, state); |
| 2512 | var save = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo; |
| 2513 | line.stateAfter = save ? copyState(doc.mode, state) : null; |
| 2514 | ++pos; |
| 2515 | }); |
| 2516 | if (precise) doc.frontier = pos; |
| 2517 | return state; |
| 2518 | } |
| 2519 | |
| 2520 | // POSITION MEASUREMENT |
| 2521 |
no test coverage detected