Problem:
In render.go, width is calculated using len([]rune(plain)):
pad := cols - len([]rune(plain)) - 4
len([]rune(s)) counts Unicode code points, not terminal display columns. CJK characters and certain emoji occupy 2 terminal columns each, so this calculation produces an incorrect result for any string containing wide characters, leading to misaligned or wrapped output.
Solution:
Replace len([]rune(s)) with lipgloss.Width(s) which uses a proper display-width algorithm consistent with the rest of the codebase.
Acceptance Criteria:
Problem:
In
render.go, width is calculated usinglen([]rune(plain)):len([]rune(s))counts Unicode code points, not terminal display columns. CJK characters and certain emoji occupy 2 terminal columns each, so this calculation produces an incorrect result for any string containing wide characters, leading to misaligned or wrapped output.Solution:
Replace
len([]rune(s))withlipgloss.Width(s)which uses a proper display-width algorithm consistent with the rest of the codebase.Acceptance Criteria:
render.gouselipgloss.Widthinstead oflen([]rune(…))