diff options
| author | Sijie Wang <[email protected]> | 2025-07-25 15:36:42 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-25 22:36:42 +0000 |
| commit | fbdc8d5ab3f76aef32af6a8f516d97771c56a7ac (patch) | |
| tree | 2167cd9ab4c5a1378d466e735bc41e167ea4d904 /packages/cli/src/ui/components/InputPrompt.tsx | |
| parent | aa71438684dd0350acf62fc01d1e6244fd4d3f51 (diff) | |
Vim mode (#3936)
Diffstat (limited to 'packages/cli/src/ui/components/InputPrompt.tsx')
| -rw-r--r-- | packages/cli/src/ui/components/InputPrompt.tsx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/cli/src/ui/components/InputPrompt.tsx b/packages/cli/src/ui/components/InputPrompt.tsx index 8d296dc4..17b7694e 100644 --- a/packages/cli/src/ui/components/InputPrompt.tsx +++ b/packages/cli/src/ui/components/InputPrompt.tsx @@ -39,6 +39,7 @@ export interface InputPromptProps { suggestionsWidth: number; shellModeActive: boolean; setShellModeActive: (value: boolean) => void; + vimHandleInput?: (key: Key) => boolean; } export const InputPrompt: React.FC<InputPromptProps> = ({ @@ -55,6 +56,7 @@ export const InputPrompt: React.FC<InputPromptProps> = ({ suggestionsWidth, shellModeActive, setShellModeActive, + vimHandleInput, }) => { const [justNavigatedHistory, setJustNavigatedHistory] = useState(false); @@ -169,6 +171,10 @@ export const InputPrompt: React.FC<InputPromptProps> = ({ return; } + if (vimHandleInput && vimHandleInput(key)) { + return; + } + if ( key.sequence === '!' && buffer.text === '' && @@ -347,6 +353,7 @@ export const InputPrompt: React.FC<InputPromptProps> = ({ shellHistory, handleClipboardImage, resetCompletionState, + vimHandleInput, ], ); |
