void (final @NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { if (!editor.getCaretModel().supportsMultipleCarets()) { EditorActionUtil.moveCaretPageUp(editor, true); return; } if (editor.isColumnMode()) { int lines = editor.getScrollingModel().getVisibleArea().height / editor.getLineHeight(); CloneCaretActionHandler handler = new CloneCaretActionHandler(true); for (int i = 0; i < lines; i++) { handler.execute(editor, caret, dataContext); handler.setRepeatedInvocation(true); } } else { if (caret == null) { editor.getCaretModel().runForEachCaret(__ -> EditorActionUtil.moveCaretPageUp(editor, true)); } else { // assuming caret is equal to CaretModel.getCurrentCaret() EditorActionUtil.moveCaretPageUp(editor, true); } } }