void (final @NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { int lineShift = myDirection == MoveCaretUpOrDownHandler.Direction.DOWN ? 1 : -1; if (!editor.getCaretModel().supportsMultipleCarets()) { editor.getCaretModel().moveCaretRelatively(0, lineShift, true, editor.isColumnMode(), true); return; } if (editor.isColumnMode()) { new CloneCaretActionHandler(myDirection == MoveCaretUpOrDownHandler.Direction.UP).execute(editor, caret, dataContext); } else { CaretAction caretAction = c -> c.moveCaretRelatively(0, lineShift, true, c == editor.getCaretModel().getPrimaryCaret()); if (caret == null) { editor.getCaretModel().runForEachCaret(caretAction); } else { caretAction.perform(caret); } } }