Fix bug updating the cursor after navigating history. (#507)

This commit is contained in:
Jacob Richman 2025-05-23 09:40:01 -07:00 committed by GitHub
parent a008d81780
commit a96ff934ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 269 additions and 16 deletions

View file

@ -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;