diff --git a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/KeymapScheme.java b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/KeymapScheme.java index 5c25d402a146..8b1b1f12cee1 100644 --- a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/KeymapScheme.java +++ b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/KeymapScheme.java @@ -54,7 +54,7 @@ final class KeymapScheme implements Scheme { } @NotNull - Keymap getCurrent() { + KeymapImpl getCurrent() { return mutable != null ? mutable : original; } @@ -83,26 +83,21 @@ final class KeymapScheme implements Scheme { } boolean canReset() { - return mutable != null && !mutable.equals(original); + return getCurrent().getOwnActionIds().length > 0; } void reset() { assert canReset() : "reset all modified shortcuts unexpectedly"; - mutable = null; + getMutable().clearOwnActionsIds(); } boolean canReset(@NotNull String actionId) { - return mutable != null && !deepEquals(original.getShortcuts(actionId), mutable.getShortcuts(actionId)); + return getCurrent().hasOwnActionId(actionId); } void reset(@NotNull String actionId) { assert canReset(actionId) : "reset modified action shortcuts unexpectedly"; - if (mutable != null) { - mutable.removeAllActionShortcuts(actionId); - for (Shortcut shortcut : original.getShortcuts(actionId)) { - mutable.addShortcut(actionId, shortcut); - } - } + getMutable().clearOwnActionsId(actionId); } @NotNull diff --git a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/KeymapSelector.java b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/KeymapSelector.java index ad5963e042ff..2e78f6bf3d41 100644 --- a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/KeymapSelector.java +++ b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/KeymapSelector.java @@ -104,7 +104,9 @@ final class KeymapSelector extends SimpleSchemesPanel implements S void resetActionInKeymap(Keymap mutable, String actionId) { KeymapScheme scheme = find(mutable); - if (scheme != null) scheme.reset(actionId); + if (scheme == null) return; + scheme.reset(actionId); + selectKeymap(scheme, false); } private KeymapScheme find(Keymap keymap) {