ShortcutSet (@NotNull DataContext context) { if (KeymapUtil.isEmacsKeymap()) return null; SearchSession search = context.getData(SearchSession.KEY); if (search != null) { boolean replaceState = search.getFindModel().isReplaceState() && !Registry.is("ide.find.use.search.in.selection.keyboard.shortcut.for.replace"); AnAction action = ActionManager.getInstance().getAction( replaceState ? IdeActions.ACTION_REPLACE : IdeActions.ACTION_TOGGLE_FIND_IN_SELECTION_ONLY); return action != null ? action.getShortcutSet() : null; } return null; }