mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-28 11:41:04 +00:00
Vim mode (#3936)
This commit is contained in:
parent
aa71438684
commit
fbdc8d5ab3
21 changed files with 5324 additions and 191 deletions
|
|
@ -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,
|
||||
],
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue