@Override
  public int getSelectionEnd() {
    ApplicationManager.getApplication().assertReadAccessAllowed();
    if (hasSelection()) {
      RangeMarker marker = mySelectionMarker;
      if (marker != null) {
        return marker.getEndOffset();
      }
    }
    return getOffset();
  }
@Override
  public int getSelectionEnd()