void (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); } }