mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-21 02:24:09 -07:00
Remove sequence binding (#16664)
This commit is contained in:
committed by
GitHub
parent
5ed275ce39
commit
fb7640886b
@@ -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 })],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user