@Override
  public @NotNull TextRange getSelectionRange() {
    ApplicationManager.getApplication().assertReadAccessAllowed();
    SelectionMarker marker = mySelectionMarker;
    if (hasSelection(marker)) {
      return marker.getTextRange();
    }
    else {
      int offset = getOffset();
      return TextRange.create(offset, offset);
    }
  }
@Override
  public @NotNull TextRange getSelectionRange()