Function TextRange.singleLine

returns true if start and end located at the same line

bool singleLine() @property const;