if (offset >= getCharCount()) { return offset; }
int getWordEnd(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 {		TextLayout layout = renderer.getTextLayout(lineText, lineOffset);		offset -= lineOffset;		offset = layout.getNextOffset(offset, SWT.MOVEMENT_WORD);		offset += lineOffset;		renderer.disposeTextLayout(layout);	}	return offset;}