(cm, n)
| 899 | // smallest indentation, which tends to need the least context to |
| 900 | // parse correctly. |
| 901 | function findStartLine(cm, n) { |
| 902 | var minindent, minline, doc = cm.doc; |
| 903 | for (var search = n, lim = n - 100; search > lim; --search) { |
| 904 | if (search <= doc.first) return doc.first; |
| 905 | var line = getLine(doc, search - 1); |
| 906 | if (line.stateAfter) return search; |
| 907 | var indented = countColumn(line.text, null, cm.options.tabSize); |
| 908 | if (minline == null || minindent > indented) { |
| 909 | minline = search - 1; |
| 910 | minindent = indented; |
| 911 | } |
| 912 | } |
| 913 | return minline; |
| 914 | } |
| 915 | |
| 916 | function getStateBefore(cm, n) { |
| 917 | var doc = cm.doc, display = cm.display; |
no test coverage detected