caretLine = content.getLineAtOffset(caretOffset);
public void setCaretOffset(int offset) {	checkWidget();	int length = getCharCount();					if (length > 0 && offset != caretOffset) {		if (offset < 0) {			caretOffset = 0;			caretLine = 0;		}		else		if (offset > length) {			caretOffset = length;			caretLine = content.getLineCount() - 1;		}		else {			if (isLineDelimiter(offset)) {				// offset is inside a multi byte line delimiter. This is an 				// illegal operation and an exception is thrown. Fixes 1GDKK3R				SWT.error(SWT.ERROR_INVALID_ARGUMENT);			}			caretOffset = offset;			caretLine = content.getLineAtOffset(caretOffset);		}		// clear the selection if the caret is moved.		// don't notify listeners about the selection change.		clearSelection(false);	}	// always update the caret location. fixes 1G8FODP	setCaretLocation();	if (isBidi()) {		setBidiKeyboardLanguage();		}}	