From 0234922fd0c0531f37625e3ec39e409d1cffe2df Mon Sep 17 00:00:00 2001 From: Aleksey Pivovarov Date: Thu, 17 Mar 2016 19:08:10 +0300 Subject: [PATCH] EA-80750 - assert: AnAction.setShortcutSet before this fix, it worked only for the first search field in IDE, because after the first time the shortcut is no longer empty (we registered it), and action was not registered on component any more. --- .../platform-api/src/com/intellij/ui/SearchTextField.java | 5 +---- platform/platform-resources/src/idea/Keymap_Default.xml | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/platform/platform-api/src/com/intellij/ui/SearchTextField.java b/platform/platform-api/src/com/intellij/ui/SearchTextField.java index 58fbfd79909f..f79d7528e371 100644 --- a/platform/platform-api/src/com/intellij/ui/SearchTextField.java +++ b/platform/platform-api/src/com/intellij/ui/SearchTextField.java @@ -18,7 +18,6 @@ package com.intellij.ui; import com.intellij.icons.AllIcons; import com.intellij.openapi.actionSystem.ActionManager; import com.intellij.openapi.actionSystem.AnAction; -import com.intellij.openapi.actionSystem.CommonShortcuts; import com.intellij.openapi.actionSystem.IdeActions; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.ui.JBMenuItem; @@ -204,9 +203,7 @@ public class SearchTextField extends JPanel { final ActionManager actionManager = ActionManager.getInstance(); if (actionManager != null) { final AnAction clearTextAction = actionManager.getAction(IdeActions.ACTION_CLEAR_TEXT); - if (clearTextAction.getShortcutSet().getShortcuts().length == 0) { - clearTextAction.registerCustomShortcutSet(CommonShortcuts.ESCAPE, this); - } + clearTextAction.registerCustomShortcutSet(clearTextAction.getShortcutSet(), this); } } } diff --git a/platform/platform-resources/src/idea/Keymap_Default.xml b/platform/platform-resources/src/idea/Keymap_Default.xml index d55e485180aa..83773d111b93 100644 --- a/platform/platform-resources/src/idea/Keymap_Default.xml +++ b/platform/platform-resources/src/idea/Keymap_Default.xml @@ -15,9 +15,9 @@ - +