void (@NotNull Editor editor, int position) { ReadAction.run(() -> { int caretY = editor.visualLineToY(editor.getCaretModel().getVisualPosition().line); editor.getScrollingModel().scrollVertically(caretY - position); }); }