Block () { popUntilTopBlockStartsNewLine(); Block current = myStack.peek(); TextRange currentBlockRange = current.getTextRange(); myCurrentDocumentLine = myDocument.getLineNumber(currentBlockRange.getStartOffset()); myCurrentDocumentLine++; if (myCurrentDocumentLine < myTotalLines) { myCurrentLineStartOffset = myDocument.getLineStartOffset(myCurrentDocumentLine); if (currentBlockRange.getEndOffset() < myCurrentLineStartOffset) { myStack.pop(); } else { pushAll(current); } } return current; }