mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-28 19:52:02 +00:00
Fix bug updating the cursor after navigating history. (#507)
This commit is contained in:
parent
a008d81780
commit
a96ff934ea
3 changed files with 269 additions and 16 deletions
|
|
@ -81,20 +81,12 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
|
|||
[onSubmit, buffer, resetCompletionState],
|
||||
);
|
||||
|
||||
const onChangeAndMoveCursor = useCallback(
|
||||
(newValue: string) => {
|
||||
buffer.setText(newValue);
|
||||
buffer.move('end');
|
||||
},
|
||||
[buffer],
|
||||
);
|
||||
|
||||
const inputHistory = useInputHistory({
|
||||
userMessages,
|
||||
onSubmit: handleSubmitAndClear,
|
||||
isActive: !completion.showSuggestions,
|
||||
currentQuery: buffer.text,
|
||||
onChangeAndMoveCursor,
|
||||
onChange: buffer.setText,
|
||||
});
|
||||
|
||||
const completionSuggestions = completion.suggestions;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue