szn

Bug 235 — Ghost character artifacts and dropped UTF-8 combining marks on soft wraps

235. Ghost character artifacts and dropped UTF-8 combining marks on soft wraps

File: src/screen.zig:510–560 Severity: HIGH Status: ✅ FIXED

  1. Ghost Character Artifact: When a 2-column wide character forces a wrap at column width - 1, the cell at the previous cursor position is left un-cleared before wrapping to the next line.
  2. Combining Mark Dropping: If a zero-width combining mark lands when cursor.x == 0 right after a soft-wrap, writeChar discards it (if (self.cursor.x == 0) return;).

Impact: Visual artifact on line right edge and missing accents/diacritics across line wraps.

Fix: Clear getCellMut(self.cursor.x, self.cursor.y) before wrapping for 2-column characters. For combining marks at cursor.x == 0, attach the mark to the last cell of the preceding wrapped line if cursor.y > 0.