diff --git a/platform/platform-api/src/com/intellij/util/EditSourceOnEnterKeyHandler.java b/platform/platform-api/src/com/intellij/util/EditSourceOnEnterKeyHandler.java index 136cfd413f52..b97afc600cc4 100644 --- a/platform/platform-api/src/com/intellij/util/EditSourceOnEnterKeyHandler.java +++ b/platform/platform-api/src/com/intellij/util/EditSourceOnEnterKeyHandler.java @@ -33,10 +33,6 @@ public final class EditSourceOnEnterKeyHandler { } public static void install(@NotNull JComponent component, @Nullable Runnable whenPerformed) { - install(component, whenPerformed, Registry.is("edit.source.on.enter.key.request.focus.in.editor")); - } - - private static void install(@NotNull JComponent component, @Nullable Runnable whenPerformed, boolean requestFocus) { onEnterKey(component, () -> { if (Registry.is("edit.source.on.enter.key.disabled")) return false; if (isOverriddenByAction(IdeActions.ACTION_EDIT_SOURCE)) return false; @@ -44,6 +40,7 @@ public final class EditSourceOnEnterKeyHandler { DataContext context = DataManager.getInstance().getDataContext(component); List navigatables = getNavigatables(context); if (navigatables.isEmpty()) return false; // nowhere to navigate + boolean requestFocus = Registry.is("edit.source.on.enter.key.request.focus.in.editor"); navigatables.forEach(navigatable -> navigatable.navigate(requestFocus)); if (whenPerformed != null) whenPerformed.run(); return true; diff --git a/platform/util/resources/misc/registry.properties b/platform/util/resources/misc/registry.properties index 8871688c91f4..fe6124825a77 100644 --- a/platform/util/resources/misc/registry.properties +++ b/platform/util/resources/misc/registry.properties @@ -177,7 +177,7 @@ ide.tree.expand.navigatable.on.double.click.disabled.description=Allows to preve edit.source.on.enter.key.disabled=false edit.source.on.enter.key.disabled.description=Allows to prevent navigation on the Enter key pressed -edit.source.on.enter.key.request.focus.in.editor=false +edit.source.on.enter.key.request.focus.in.editor=true edit.source.on.enter.key.request.focus.in.editor.description=Specifies whether focus will be moved to the editor on the key pressed or not edit.source.on.enter.key.non.source.navigation.enabled=false edit.source.on.enter.key.non.source.navigation.enabled.description=Allows navigation even if navigatable object cannot navigate to editor