mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-14 07:10:34 -07:00
refactor: migrate to useKeyMatchers hook (#21753)
This commit is contained in:
committed by
GitHub
parent
e406dcc249
commit
ab64b15d51
@@ -4,9 +4,12 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { Command, keyMatchers } from '../keyMatchers.js';
|
||||
import { Command } from '../keyMatchers.js';
|
||||
import type { Key } from '../hooks/useKeypress.js';
|
||||
import { useKeyMatchers } from '../hooks/useKeyMatchers.js';
|
||||
|
||||
export function shouldDismissShortcutsHelpOnHotkey(key: Key): boolean {
|
||||
return Object.values(Command).some((command) => keyMatchers[command](key));
|
||||
export function useIsHelpDismissKey(): (key: Key) => boolean {
|
||||
const keyMatchers = useKeyMatchers();
|
||||
return (key: Key) =>
|
||||
Object.values(Command).some((command) => keyMatchers[command](key));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user