boolean isRightOriented = (getStyle() & SWT.MIRRORED) != 0;
boolean isRightOriented = isMirrored();
void doVisualNext() {	int line = content.getLineAtOffset(caretOffset);	int lineOffset = content.getOffsetAtLine(line);		int offsetInLine = caretOffset - lineOffset;	String lineText = content.getLine(line);	int lineLength = lineText.length();		if (isBidi()) {		GC gc = getGC();		StyledTextBidi bidi = getStyledTextBidi(lineText, lineOffset, gc);		// Fixes bug 39032		int lineEndPixel = Math.max(bidi.getTextWidth(), XINSET); 		// check if caret location is at the visual end of the line (can't use 		// caret location here since it's location is dependent on current keyboard		// language direction)		if (bidi.getTextPosition(offsetInLine, lastCaretDirection) == lineEndPixel) {			gc.dispose(); 			return;		}		int visualOffset = -1;		if (offsetInLine == lineLength) {			//logical end of line may not be visual end, setup visualOffset to process as usual			visualOffset = bidi.getVisualOffset(offsetInLine - 1);		}		else		if (offsetInLine < lineLength) {			visualOffset = bidi.getVisualOffset(offsetInLine);		}		if (visualOffset != -1) {			visualOffset++;			offsetInLine = bidi.getLogicalOffset(visualOffset);			if (offsetInLine > 0 && offsetInLine < lineLength) {				boolean isRightOriented = (getStyle() & SWT.MIRRORED) != 0;				if (isRightOriented) {					boolean leftToRightStart = bidi.isRightToLeft(offsetInLine) == false && bidi.isRightToLeft(offsetInLine - 1);					if (leftToRightStart) {						//moving from RtoL segment to LtoR segment						lastCaretDirection = ST.COLUMN_PREVIOUS;					}										}				else {					boolean rightToLeftStart = bidi.isRightToLeft(offsetInLine) && bidi.isRightToLeft(offsetInLine - 1) == false;					if (bidi.isRightToLeftInput(offsetInLine) && bidi.isLatinNumber(offsetInLine - 1)) {						//moving from latin number to RtoL segment						lastCaretDirection = ST.COLUMN_NEXT;					}					else					if (rightToLeftStart) {						//moving from LtoR segment to RtoL segment						lastCaretDirection = ST.COLUMN_PREVIOUS;					}										}			}			caretOffset = lineOffset + offsetInLine;			showCaret();		}		gc.dispose();	}	else	if (offsetInLine < lineLength) {		caretOffset++;		showCaret();	}}