chore: multiline traversal support (#51)

Co-authored-by: Shubham Naik <shub@memgpt.ai>
This commit is contained in:
Shubham Naik
2025-11-01 10:00:04 -07:00
committed by GitHub
parent 4118d018fe
commit 14e67fa156
7 changed files with 139 additions and 42 deletions

View File

@@ -54,11 +54,6 @@ export function PasteAwareTextInput({
}
}, [cursorPosition]);
// Notify parent of cursor position changes
// Default assumption: cursor is at the end when typing
useEffect(() => {
onCursorMove?.(displayValue.length);
}, [displayValue, onCursorMove]);
const TextInputAny = RawTextInput as unknown as React.ComponentType<{
value: string;
onChange: (value: string) => void;
@@ -262,6 +257,7 @@ export function PasteAwareTextInput({
externalCursorOffset={nudgeCursorOffset}
onCursorOffsetChange={(n: number) => {
caretOffsetRef.current = n;
onCursorMove?.(n);
}}
onChange={handleChange}
onSubmit={handleSubmit}