(cm, n, precise)
| 1418 | // smallest indentation, which tends to need the least context to |
| 1419 | // parse correctly. |
| 1420 | function findStartLine(cm, n, precise) { |
| 1421 | var minindent, minline, doc = cm.doc; |
| 1422 | var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100); |
| 1423 | for (var search = n; search > lim; --search) { |
| 1424 | if (search <= doc.first) return doc.first; |
| 1425 | var line = getLine(doc, search - 1); |
| 1426 | if (line.stateAfter && (!precise || search <= doc.frontier)) return search; |
| 1427 | var indented = countColumn(line.text, null, cm.options.tabSize); |
| 1428 | if (minline == null || minindent > indented) { |
| 1429 | minline = search - 1; |
| 1430 | minindent = indented; |
| 1431 | } |
| 1432 | } |
| 1433 | return minline; |
| 1434 | } |
| 1435 | |
| 1436 | function getStateBefore(cm, n, precise) { |
| 1437 | var doc = cm.doc, display = cm.display; |
no test coverage detected
searching dependent graphs…