(n)
| 1773 | // smallest indentation, which tends to need the least context to |
| 1774 | // parse correctly. |
| 1775 | function findStartLine(n) { |
| 1776 | var minindent, minline; |
| 1777 | for (var search = n, lim = n - 40; search > lim; --search) { |
| 1778 | if (search == 0) return 0; |
| 1779 | var line = getLine(search-1); |
| 1780 | if (line.stateAfter) return search; |
| 1781 | var indented = line.indentation(options.tabSize); |
| 1782 | if (minline == null || minindent > indented) { |
| 1783 | minline = search - 1; |
| 1784 | minindent = indented; |
| 1785 | } |
| 1786 | } |
| 1787 | return minline; |
| 1788 | } |
| 1789 | function getStateBefore(n) { |
| 1790 | var start = findStartLine(n), state = start && getLine(start-1).stateAfter; |
| 1791 | if (!state) state = startState(mode); |
no test coverage detected