if (p.x > relativePosition.x)
widgetOffset--;
// Convert to model offset
if (fCachedTextViewer instanceof ITextViewerExtension5) {
ITextViewerExtension5 extension= (ITextViewerExtension5)fCachedTextViewer;
offset= extension.widgetOffset2ModelOffset(widgetOffset);
} else
offset= widgetOffset + fCachedTextViewer.getVisibleRegion().getOffset();
} catch (IllegalArgumentException ex) {
int lineEndOffset= lineInfo.getOffset() + lineInfo.getLength();
// Convert to widget offset
int lineEndWidgetOffset;
if (fCachedTextViewer instanceof ITextViewerExtension5) {
ITextViewerExtension5 extension= (ITextViewerExtension5)fCachedTextViewer;
lineEndWidgetOffset= extension.modelOffset2WidgetOffset(lineEndOffset);
} else
lineEndWidgetOffset= lineEndOffset - fCachedTextViewer.getVisibleRegion().getOffset();
Point p= fCachedTextWidget.getLocationAtOffset(lineEndWidgetOffset);
if (p.x < relativePosition.x)