int (int startLine, int indentThreshold) { int blockEnd = startLine - 1; int lineNum = startLine; while (lineNum < getLineCount() && !isBlockEnd(lineNum)) { if (!isEmpty(lineNum)) { if (getLineIndentSize(lineNum) > indentThreshold) { blockEnd = lineNum; } else { break; } } lineNum++; } return blockEnd + 1; }