summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/components/InputPrompt.tsx
diff options
context:
space:
mode:
authorJacob Richman <[email protected]>2025-05-23 09:40:01 -0700
committerGitHub <[email protected]>2025-05-23 09:40:01 -0700
commita96ff934eacdedfea16ae91a0e63858b15c4b593 (patch)
tree6b3e38e56514e393b623182108d36b53605dbaa9 /packages/cli/src/ui/components/InputPrompt.tsx
parenta008d8178015a182656ea8f5a39b9dde554da5ae (diff)
Fix bug updating the cursor after navigating history. (#507)
Diffstat (limited to 'packages/cli/src/ui/components/InputPrompt.tsx')
-rw-r--r--packages/cli/src/ui/components/InputPrompt.tsx10
1 files changed, 1 insertions, 9 deletions
diff --git a/packages/cli/src/ui/components/InputPrompt.tsx b/packages/cli/src/ui/components/InputPrompt.tsx
index bc514464..730aed48 100644
--- a/packages/cli/src/ui/components/InputPrompt.tsx
+++ b/packages/cli/src/ui/components/InputPrompt.tsx
@@ -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;