if (offset >= getCharCount()) { return offset; }
int getWordEndNoSpaces(int offset) {	int line = logicalContent.getLineAtOffset(offset);	int lineOffset = logicalContent.getOffsetAtLine(line);	String lineText = logicalContent.getLine(line);	int lineLength = lineText.length();		if (offset >= getCharCount()) {		return offset;	}	if (offset == lineOffset + lineLength) {		line++;		offset = logicalContent.getOffsetAtLine(line);	}	else {		offset -= lineOffset;		char ch = lineText.charAt(offset);		boolean letterOrDigit = Compatibility.isLetterOrDigit(ch);				while (offset < lineLength - 1 && Compatibility.isLetterOrDigit(ch) == letterOrDigit && !Compatibility.isSpaceChar(ch)) {			offset++;			ch = lineText.charAt(offset);		}		if (offset == lineLength - 1 && Compatibility.isLetterOrDigit(ch) == letterOrDigit && !Compatibility.isSpaceChar(ch)) {			offset++;		}		offset += lineOffset;	}	return offset;}