function lastNonEmptyLineNumber(cm) {
        var lc = cm.lastLine(), line = cm.getLine(lc);
        while (lc > 0 && line.trim().length === 0) {
            lc--;
            line = cm.getLine(lc);
        }
        return lc;
    }
Fold range finder based on line indentations. Ignores blank lines and commented lines
@author Patrick Oladimeji
@date 12/27/13 21:54:41 PM