336
lookupMap = kbCandidates;
337
} else {
339
>
lookupMap = [];
340
>
for (let i = 0, len = kbCandidates.length; i < len; i++) {
341
>
342
>
const candidate = kbCandidates[i];
343
>
344
>
if (pressedChords.length > candidate.chords.length) { // # of pressed chords can't be less than # of chords in a keybinding to invoke
345
continue;
346
}
348
>
let prefixMatches = true;
349
>
for (let i = 1; i < pressedChords.length; i++) {
350
>
if (candidate.chords[i] !== pressedChords[i]) {
351
prefixMatches = false;
352
break;
353
}
355
>
if (prefixMatches) {
356
lookupMap.push(candidate);
357
}
359
>
}
360
361
// check there's a keybinding with a matching when clause