LogicalPosition (final int offset) { assertValid(); int lineNumber = myDocumentWindow.getLineNumber(offset); int lineStartOffset = myDocumentWindow.getLineStartOffset(lineNumber); int column = calcLogicalColumnNumber(offset - lineStartOffset, lineNumber, lineStartOffset); return new LogicalPosition(lineNumber, column); }