void (@NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { if (caret == null ? editor.getSelectionModel().hasSelection(true) : caret.hasSelection()) { EditorUIUtil.hideCursorInEditor(editor); CommandProcessor.getInstance().setCurrentCommandGroupId(EditorActionUtil.DELETE_COMMAND_GROUP); CopyPasteManager.getInstance().stopKillRings(); CaretAction action = c -> EditorModificationUtil.deleteSelectedText(editor); if (caret == null) editor.getCaretModel().runForEachCaret(action); else action.perform(caret); } else { myOriginalHandler.execute(editor, caret, dataContext); } }