From 208f64d68dc6d0eca840ec10b46892d4f39c8e11 Mon Sep 17 00:00:00 2001 From: Mikhail Sokolov Date: Tue, 14 Jul 2020 20:32:35 +0300 Subject: [PATCH] IDEA-216720 "Ctrl+E" shortcut is displayed in "Recent Files" popup if it was removed from the keymap GitOrigin-RevId: 4aa660023e23199c674376b945eb8f879d8728e3 --- .../com/intellij/ide/actions/Switcher.java | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/ide/actions/Switcher.java b/platform/platform-impl/src/com/intellij/ide/actions/Switcher.java index 5fa1afa03412..11a133f3a2a4 100644 --- a/platform/platform-impl/src/com/intellij/ide/actions/Switcher.java +++ b/platform/platform-impl/src/com/intellij/ide/actions/Switcher.java @@ -232,10 +232,6 @@ public final class Switcher extends AnAction implements DumbAware { Project project = e.getProject(); e.getPresentation().setEnabledAndVisible(SWITCHER_KEY.get(project) != null); } - - static boolean isEnabled() { - return getActiveKeymapShortcuts(TOGGLE_CHECK_BOX_ACTION_ID).getShortcuts().length > 0; - } } public static class IterateItemsAction extends DumbAwareAction implements DumbAware { @@ -552,9 +548,7 @@ public final class Switcher extends AnAction implements DumbAware { myClickListener.installOn(files); ScrollingUtil.ensureSelectionExists(files); - myShowOnlyEditedFilesCheckBox = new MyCheckBox(ToggleCheckBoxAction.isEnabled() ? TOGGLE_CHECK_BOX_ACTION_ID - : actionId, - onlyEdited); + myShowOnlyEditedFilesCheckBox = new MyCheckBox(TOGGLE_CHECK_BOX_ACTION_ID, onlyEdited); myTopPanel = createTopPanel(myShowOnlyEditedFilesCheckBox, isCheckboxMode() ? IdeBundle.message("title.popup.recent.files") : title, pinned); @@ -1407,12 +1401,14 @@ public final class Switcher extends AnAction implements DumbAware { } private static String layoutText(@NotNull String actionId) { + String text = "" + IdeBundle.message("recent.files.checkbox.label"); ShortcutSet shortcuts = getActiveKeymapShortcuts(actionId); - return "" - + IdeBundle.message("recent.files.checkbox.label") - + " " - + KeymapUtil.getShortcutsText(shortcuts.getShortcuts()) + "" - + ""; + if (shortcuts.getShortcuts().length > 0) { + text += " " + + KeymapUtil.getShortcutsText(shortcuts.getShortcuts()) + "" + + ""; + } + return text; } }