mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-14 03:50:49 -07:00
refactor: migrate to useKeyMatchers hook (#21753)
This commit is contained in:
committed by
GitHub
parent
cc43cfa810
commit
f7d284a43a
@@ -6,8 +6,9 @@
|
||||
|
||||
import { useReducer, useRef, useEffect, useCallback } from 'react';
|
||||
import { useKeypress, type Key } from './useKeypress.js';
|
||||
import { keyMatchers, Command } from '../keyMatchers.js';
|
||||
import { Command } from '../keyMatchers.js';
|
||||
import { debugLogger } from '@google/gemini-cli-core';
|
||||
import { useKeyMatchers } from './useKeyMatchers.js';
|
||||
|
||||
export interface SelectionListItem<T> {
|
||||
key: string;
|
||||
@@ -290,6 +291,7 @@ export function useSelectionList<T>({
|
||||
focusKey,
|
||||
priority,
|
||||
}: UseSelectionListOptions<T>): UseSelectionListResult {
|
||||
const keyMatchers = useKeyMatchers();
|
||||
const baseItems = toBaseItems(items);
|
||||
|
||||
const [state, dispatch] = useReducer(selectionListReducer, {
|
||||
@@ -460,7 +462,7 @@ export function useSelectionList<T>({
|
||||
}
|
||||
return false;
|
||||
},
|
||||
[dispatch, itemsLength, showNumbers],
|
||||
[dispatch, itemsLength, showNumbers, keyMatchers],
|
||||
);
|
||||
|
||||
useKeypress(handleKeypress, {
|
||||
|
||||
Reference in New Issue
Block a user