diff --git a/packages/core/src/browser/keybinding.spec.ts b/packages/core/src/browser/keybinding.spec.ts index 545ba39719746..4424883dd41e5 100644 --- a/packages/core/src/browser/keybinding.spec.ts +++ b/packages/core/src/browser/keybinding.spec.ts @@ -274,7 +274,7 @@ describe('keybindings', () => { expect(bindings[0].keybinding).to.be.equal(validKeyBinding); }); - it('shadowed bindings should not be returned', () => { + it('shadowed bindings should be returned last', () => { const keyCode = KeyCode.createKeyCode({ first: Key.KEY_A, modifiers: [KeyModifier.Shift] }); let bindings: Keybinding[]; @@ -304,14 +304,14 @@ describe('keybindings', () => { // now WORKSPACE bindings are overriding the other scopes bindings = keybindingRegistry.getKeybindingsForKeySequence([keyCode]).full; - expect(bindings).to.have.lengthOf(1); + expect(bindings).to.have.lengthOf(3); expect(bindings[0].command).to.be.equal(workspaceBinding.command); keybindingRegistry.resetKeybindingsForScope(KeybindingScope.WORKSPACE); // now it should find USER bindings bindings = keybindingRegistry.getKeybindingsForKeySequence([keyCode]).full; - expect(bindings).to.have.lengthOf(1); + expect(bindings).to.have.lengthOf(2); expect(bindings[0].command).to.be.equal(userBinding.command); keybindingRegistry.resetKeybindingsForScope(KeybindingScope.USER); diff --git a/packages/core/src/browser/keybinding.ts b/packages/core/src/browser/keybinding.ts index abba68e69e811..51e7f70f1b304 100644 --- a/packages/core/src/browser/keybinding.ts +++ b/packages/core/src/browser/keybinding.ts @@ -424,12 +424,6 @@ export class KeybindingRegistry { for (let scope = KeybindingScope.END; --scope >= KeybindingScope.DEFAULT;) { const matches = this.getKeySequenceCollisions(this.keymaps[scope], keySequence); - - matches.full = matches.full.filter( - binding => this.getKeybindingCollisions(result.full, binding).full.length === 0); - matches.partial = matches.partial.filter( - binding => this.getKeybindingCollisions(result.partial, binding).partial.length === 0); - if (scope === KeybindingScope.DEFAULT_OVERRIDING) { matches.full.reverse(); matches.partial.reverse();