Skip to content

fix: collapse orphaned wide-char lead on trailing-column overlay - #86

Draft
natemoo-re wants to merge 3 commits into
mainfrom
nm/repro/wide-char-overlay
Draft

fix: collapse orphaned wide-char lead on trailing-column overlay#86
natemoo-re wants to merge 3 commits into
mainfrom
nm/repro/wide-char-overlay

Conversation

@natemoo-re

@natemoo-re natemoo-re commented Jun 5, 2026

Copy link
Copy Markdown
Member
  • Fixes 🐛 Overlay onto a wide char's trailing column is dropped #75
  • Floating a narrow glyph onto the trailing column of an already-placed wide char dropped the overlay: the present loops advanced past the trailing column, so the wide char painted over both cells and the glyph was never emitted
  • present_cups and present_lines now detect a partial overwrite (a wide char whose trailing back-buffer cell holds a non-space glyph), collapse the orphaned lead to a space at width 1, and let the overlay glyph emit on the next column
  • Symmetric change in both present paths; rows without overlapping writes on wide chars stay byte-for-byte identical; cleanup only triggers on a detected overwrite
  • The regression lives in test/width.test.ts under describe("wide characters") rather than a standalone file. fix: cluster base + U+FE0F as a width-2 emoji glyph #84 also adds to test/width.test.ts (describe("emoji width")), so whichever merges second needs a trivial rebase to keep both describes
  • Test plan: deno test green (8 passed); deno lint + deno fmt --check clean

@pkg-pr-new

pkg-pr-new Bot commented Jun 5, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@bomb.sh/tty@86

commit: 27a9255

@natemoo-re
natemoo-re force-pushed the nm/repro/wide-char-overlay branch from b2240c3 to 7ebeb93 比较 June 5, 2026 06:14
@codspeed-hq

codspeed-hq Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 10 untouched benchmarks


Comparing nm/repro/wide-char-overlay (27a9255) with main (d4bc79b)

Open in CodSpeed

When a narrow glyph is floated onto the trailing column of an
already-placed wide char, the present loops skipped the trailing
column and the overlay was dropped (the wide char painted over both
cells). Detect the partial overwrite (non-space trailing cell) and
collapse the orphaned lead to a space at width 1 so the overlay glyph
emits. Applied symmetrically to present_cups and present_lines; rows
without overlapping writes stay byte-for-byte identical.

Fixes #75
@natemoo-re
natemoo-re force-pushed the nm/repro/wide-char-overlay branch from c12cd67 to 27a9255 比较 August 21, 2026 02:42
@github-actions

Copy link
Copy Markdown

Size Increased — +0.1 KB

118.3 KB unpacked

注册 for free to join this conversation on GitHub. Already have an account? 登录 to comment

项目

None yet

Development

Successfully merging this pull request may close these issues.

🐛 Overlay onto a wide char's trailing column is dropped

1 participant