(cm, n, precise)
| 1419 | } |
| 1420 | |
| 1421 | function getStateBefore(cm, n, precise) { |
| 1422 | var doc = cm.doc, display = cm.display; |
| 1423 | if (!doc.mode.startState) return true; |
| 1424 | var pos = findStartLine(cm, n, precise), state = pos > doc.first && getLine(doc, pos-1).stateAfter; |
| 1425 | if (!state) state = startState(doc.mode); |
| 1426 | else state = copyState(doc.mode, state); |
| 1427 | doc.iter(pos, n, function(line) { |
| 1428 | processLine(cm, line.text, state); |
| 1429 | var save = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo; |
| 1430 | line.stateAfter = save ? copyState(doc.mode, state) : null; |
| 1431 | ++pos; |
| 1432 | }); |
| 1433 | if (precise) doc.frontier = pos; |
| 1434 | return state; |
| 1435 | } |
| 1436 | |
| 1437 | // POSITION MEASUREMENT |
| 1438 |
no test coverage detected