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