From a96ff934eacdedfea16ae91a0e63858b15c4b593 Mon Sep 17 00:00:00 2001
From: Jacob Richman <jacob314@gmail.com>
Date: Fri, 23 May 2025 09:40:01 -0700
Subject: Fix bug updating the cursor after navigating history. (#507)

---
 packages/cli/src/ui/components/InputPrompt.tsx | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

(limited to 'packages/cli/src/ui/components/InputPrompt.tsx')

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;
-- 
cgit v1.2.3

