(n)
| 1973 | // smallest indentation, which tends to need the least context to |
| 1974 | // parse correctly. |
| 1975 | function findStartLine(n) { |
| 1976 | var minindent, minline; |
| 1977 | for (var search = n, lim = n - 40; search > lim; --search) { |
| 1978 | if (search == 0) return 0; |
| 1979 | var line = getLine(search-1); |
| 1980 | if (line.stateAfter) return search; |
| 1981 | var indented = line.indentation(options.tabSize); |
| 1982 | if (minline == null || minindent > indented) { |
| 1983 | minline = search - 1; |
| 1984 | minindent = indented; |
| 1985 | } |
| 1986 | } |
| 1987 | return minline; |
| 1988 | } |
| 1989 | function getStateBefore(n) { |
| 1990 | var start = findStartLine(n), state = start && getLine(start-1).stateAfter; |
| 1991 | if (!state) state = startState(mode); |
no test coverage detected