You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CtrCmd+N is not the same as ctrlcmd+n. When it comes to the execution, yes they are, but when one has to customize the app and unregister bindings, the case sensitivity and order has to be considered.
Here is a diff describing the issue:
diff --git a/examples/api-samples/src/browser/api-samples-frontend-module.ts b/examples/api-samples/src/browser/api-samples-frontend-module.ts
index 1a397ab0a..ea7023c48 100644
--- a/examples/api-samples/src/browser/api-samples-frontend-module.ts+++ b/examples/api-samples/src/browser/api-samples-frontend-module.ts@@ -14,15 +14,43 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
-import { ContainerModule } from 'inversify';+import { injectable, ContainerModule } from 'inversify';
import { bindDynamicLabelProvider } from './label/sample-dynamic-label-provider-command-contribution';
import { bindSampleUnclosableView } from './view/sample-unclosable-view-contribution';
import { bindSampleOutputChannelWithSeverity } from './output/sample-output-channel-with-severity';
import { bindSampleMenu } from './menu/sample-menu-contribution';
+import { environment } from '@theia/application-package/lib/environment';+import { CommonMenus } from '@theia/core/lib/browser/common-frontend-contribution';+import { KeybindingContribution, KeybindingRegistry } from '@theia/core/lib/browser';+import { MenuContribution, MenuModelRegistry, CommandContribution, CommandRegistry } from '@theia/core/lib/common';
export default new ContainerModule(bind => {
bindDynamicLabelProvider(bind);
bindSampleUnclosableView(bind);
bindSampleOutputChannelWithSeverity(bind);
bindSampleMenu(bind);
+ bind(RebindKeybinding).toSelf().inSingletonScope();+ bind(CommandContribution).toService(RebindKeybinding);+ bind(MenuContribution).toService(RebindKeybinding);+ bind(KeybindingContribution).toService(RebindKeybinding);
});
++@injectable()+class RebindKeybinding implements KeybindingContribution, MenuContribution, CommandContribution {++ registerCommands(r: CommandRegistry): void {+ r.registerCommand({ id: 'my-command' }, { execute: () => console.log('my-command') });+ }++ registerMenus(r: MenuModelRegistry): void {+ r.registerMenuAction([...CommonMenus.FILE, '999_my_command'], { commandId: 'my-command' });+ }++ registerKeybindings(r: KeybindingRegistry): void {+ const kb = environment.electron.is() ? 'ctrlcmd+n' : 'alt+n'; // this works+ // const kb = environment.electron.is() ? 'CtrlCmd+N' : 'Alt+N'; // this does not+ r.unregisterKeybinding(kb);+ r.registerKeybinding({ command: 'my-command', keybinding: kb });+ }++}
One has to use the exact same string when unregistering menu action.
Bug Description:
CtrCmd+N
is not the same asctrlcmd+n
. When it comes to the execution, yes they are, but when one has to customize the app and unregister bindings, the case sensitivity and order has to be considered.Here is a diff describing the issue:
One has to use the exact same string when unregistering menu action.
theia/packages/workspace/src/browser/workspace-frontend-contribution.ts
Line 181 in a1ea230
Acceptance criteria:
CtrlCmd+Shift+X
should be the same asshift+ctrlCmd+x
Steps to Reproduce:
Additional Information
The text was updated successfully, but these errors were encountered: