zot/internal
patriceckhart 1be3f85a47 fix(tui): cursor after multi-line paste lands in wrong column
wrapLine()'s internal newLine() toggled the firstLine flag BEFORE
checking it, so the very first wrap continuation flushed to the
output WITHOUT the cont indent. Second and later continuations
were fine. Visible as:

  0: '▌ this is a very long first line that'
  1: 'will wrap around terminal boundaries'       <- no indent
  2: '  still wrapping further past this point'   <- indented

Downstream, locateCursor() in the editor assumed continuation rows
always start with cont and stripped its width when counting runes.
When the first continuation didn't actually have it, the stripping
was a no-op but the leadW was still added, so the reported visual
column for the cursor drifted by cont-width (2 cells) to the right.

Effect for the user: after drag-dropping a multi-line payload (or
pasting any text where the first paragraph wraps), the terminal
cursor rendered mid-text instead of at the end of the pasted
content. Typing still appended at the correct logical position,
so keystrokes landed in the right place in the buffer, it was
purely visual drift.

Fix: in newLine(), always write cont to cur after flushing (and
after setting firstLine = false). That makes the second row, and
every subsequent wrap continuation, carry the indent consistently.

Added three regression tests:
  - wrapLine directly: every row >= 1 has cont prefix
  - editor multi-line paste: cursor lands at logical end with
    correct visual (row, col)
  - editor long-paste-with-wrap: wrap continuations all indented
    AND cursor still lands at correct column
2026-04-19 19:50:19 +02:00
..
agent fix(tui): align slash popup descriptions across built-in + extension commands 2026-04-19 19:34:32 +02:00
assets add logo to callback page 2026-04-18 10:15:53 +02:00
auth add auto compaction 2026-04-18 10:34:08 +02:00
core fix(no-yolo): don't auto-refuse tool calls in non-interactive modes 2026-04-19 19:17:05 +02:00
extproto feat(ext): phase 4 - full-event interception, arg rewrites, /reload-ext 2026-04-19 17:02:04 +02:00
provider perf(anthropic): fix cost double-count, tighten caching, correct catalog 2026-04-19 18:57:18 +02:00
skills perf(prompt): cut system prompt to the bone (410 -> 54 tokens) 2026-04-19 17:39:38 +02:00
tui fix(tui): cursor after multi-line paste lands in wrong column 2026-04-19 19:50:19 +02:00