void (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { editor.getSelectionModel().removeSelection(); LogicalPosition caretPosition = editor.getCaretModel().getLogicalPosition(); final int line = caretPosition.line; int lineStartOffset = editor.getDocument().getLineStartOffset(line); editor.getCaretModel().moveToOffset(lineStartOffset); getHandler(IdeActions.ACTION_EDITOR_ENTER).execute(editor, caret, dataContext); editor.getCaretModel().moveToOffset(editor.getDocument().getLineStartOffset(line)); getHandler(IdeActions.ACTION_EDITOR_MOVE_LINE_END).execute(editor, caret, dataContext); }