fix: trim trailing whitespace per line in paint output to match Ink behavior

Ink's Output.get() calls .trimEnd() on each line of the rendered grid.
Without this, vue-tui's paint grid always fills the full root width with
spaces, causing raw frame output to contain 100-char-wide padding. This
broke tests using { raw: true } and made meaningful trailing-space
assertions impossible with { trimLines: true }.

Also corrects test assertions for 'set width in percent' and 'relative
position' that expected trailing spaces which Ink never produces.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Yunfei He
2026-05-25 22:36:48 +08:00
parent d1c9945cc4
commit 5a1f2eba2d
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -49,7 +49,7 @@ class Output {
placeLine(grid, op.x, op.y + lineIdx, line);
}
}
return grid.map((row) => row.join("")).join("\n");
return grid.map((row) => row.join("").trimEnd()).join("\n");
}
}