Remove sequence binding (#16664)

This commit is contained in:
Tommaso Sciortino
2026-01-14 15:09:09 -08:00
committed by GitHub
parent 5ed275ce39
commit fb7640886b
5 changed files with 9 additions and 58 deletions
+1 -4
View File
@@ -256,10 +256,7 @@ describe('keyMatchers', () => {
// External tools
{
command: Command.OPEN_EXTERNAL_EDITOR,
positive: [
createKey('x', { ctrl: true }),
{ ...createKey('\x18'), sequence: '\x18', ctrl: true },
],
positive: [createKey('x', { ctrl: true })],
negative: [createKey('x'), createKey('c', { ctrl: true })],
},
{
+1 -13
View File
@@ -13,19 +13,7 @@ import { Command, defaultKeyBindings } from '../config/keyBindings.js';
* Pure data-driven matching logic
*/
function matchKeyBinding(keyBinding: KeyBinding, key: Key): boolean {
// Either key name or sequence must match (but not both should be defined)
let keyMatches = false;
if (keyBinding.key !== undefined) {
keyMatches = keyBinding.key === key.name;
} else if (keyBinding.sequence !== undefined) {
keyMatches = keyBinding.sequence === key.sequence;
} else {
// Neither key nor sequence defined - invalid binding
return false;
}
if (!keyMatches) {
if (keyBinding.key !== key.name) {
return false;
}