Commit graph

1 commit

Author SHA1 Message Date
Stephen Dennis
e565c32775 Extract shared InputEditor for multi-line input editing
Move all input editing logic (buffer management, grapheme cluster
navigation, reflow/wrapping, cursor movement, history) from both
client/tf and client/console terminal.cpp into a shared InputEditor
class. Both terminal backends now delegate to the editor and handle
only rendering.

Key features of InputEditor:
- Multi-line wrapping: grows to 3 rows and shrinks back
- Grapheme-cluster-aware operations via co_cluster_advance()
- CJK/emoji display-width awareness via co_console_width()
- Up/Down moves within visual lines, history at edges
- Home/End = visual line boundaries; Ctrl+Home/End = buffer boundaries
- Goal column preservation on vertical movement
- Per-context input history

Also adds CTRL_HOME, CTRL_END, CTRL_UP, CTRL_DOWN key codes to the
tf client's Key enum and CSI dispatch.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 09:27:19 -06:00