@Override
  public void scrollToCaret(final @NotNull ScrollType scrollType) {
    final int position = myTextComponent.getCaretPosition();
    try {
      final Rectangle rectangle = myTextComponent.modelToView(position);
      if (rectangle != null) myTextComponent.scrollRectToVisible(rectangle);
    }
    catch (BadLocationException e) {
      throw new RuntimeException(e);
    }
  }
@Override
  public void scrollToCaret(final @NotNull ScrollType scrollType)