StyledTextEvent event = getLineStyleData(lineOffset, line);
StyledTextEvent event = renderer.getLineStyleData(lineOffset, line);
int getCaretOffsetAtX(String line, int lineOffset, int lineXOffset) {	int offset = 0;	GC gc = new GC(this);	FontData currentFont = gc.getFont().getFontData()[0];	StyleRange[] styles = null;	StyledTextEvent event = getLineStyleData(lineOffset, line);		lineXOffset += horizontalScrollOffset;	if (event != null) {		styles = filterLineStyles(event.styles);	}	int low = -1;	int high = line.length();	while (high - low > 1) {		offset = (high + low) / 2;		int x = textWidth(line, lineOffset, 0, offset, styles, 0, gc, currentFont);		int charWidth = textWidth(line, lineOffset, 0, offset + 1, styles, 0, gc, currentFont) - x;		if (lineXOffset <= x + charWidth / 2) {			high = offset;					}		else {			low = offset;		}	}	offset = high;	gc.dispose();	return offset;	}