forked from kent/consciousness
The previous approach scanned ratatui's rendered buffer to find the
cursor position, but couldn't distinguish padding spaces from text
spaces, causing incorrect cursor placement on wrapped lines.
Replace with a word_wrap_breaks() function that computes soft line
break positions by simulating ratatui's Wrap { trim: false } algorithm
(break at word boundaries, fall back to character wrap for long words).
cursor_visual_pos() then maps a character index to (col, row) using
those break positions.
Also fixes the input area height calculation to use word-wrap semantics
instead of character-wrap, matching the actual Paragraph rendering.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| api | ||
| tools | ||
| agent.rs | ||
| cli.rs | ||
| config.rs | ||
| dmn.rs | ||
| journal.rs | ||
| lib.rs | ||
| log.rs | ||
| main.rs | ||
| observe.rs | ||
| tui.rs | ||
| types.rs | ||
| ui_channel.rs | ||