(cm, n, precise)
| 1434 | } |
| 1435 | |
| 1436 | function getStateBefore(cm, n, precise) { |
| 1437 | var doc = cm.doc, display = cm.display; |
| 1438 | if (!doc.mode.startState) return true; |
| 1439 | var pos = findStartLine(cm, n, precise), state = pos > doc.first && getLine(doc, pos-1).stateAfter; |
| 1440 | if (!state) state = startState(doc.mode); |
| 1441 | else state = copyState(doc.mode, state); |
| 1442 | doc.iter(pos, n, function(line) { |
| 1443 | processLine(cm, line.text, state); |
| 1444 | var save = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo; |
| 1445 | line.stateAfter = save ? copyState(doc.mode, state) : null; |
| 1446 | ++pos; |
| 1447 | }); |
| 1448 | if (precise) doc.frontier = pos; |
| 1449 | return state; |
| 1450 | } |
| 1451 | |
| 1452 | // POSITION MEASUREMENT |
| 1453 |
no test coverage detected
searching dependent graphs…