fix(core): adjust wide-character rendering boundaries in differential…#2009
fix(core): adjust wide-character rendering boundaries in differential…#2009HarshaNaidu11 wants to merge 1 commit into
Conversation
|
Hi @HarshaNaidu11 👋 ⭐ Star this repo before your PR merges. Why? GSSoC 2026 contributors who star get priority review and points credit. After you star, push any commit (or re-run this check). The Thanks for your contribution to TermUI. |
📝 WalkthroughWalkthroughIn ChangesDiff Renderer Span Alignment Fix
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🎉 Thanks for your first PR to TermUI, @HarshaNaidu11.
Before your PR merges:
- ⭐ Star the repo. Required. The
star-checkjob blocks your merge otherwise. - ✅ All checks green:
build,test,typecheck. - 🏷 PR title follows
type: short description. Example:fix: handle empty list. - 🔗 Link your closing issue in the description.
GSSoC 2026 points come from labels after merge:
gssoc:approved. +50 base points.level:beginner/intermediate/advanced/critical. +20 / +35 / +55 / +80.quality:clean/exceptional. x 1.2 / x 1.5.type:*. Stackable bonus.
Your reviewer responds within 48 hours. Ping @Karanjot786 on Discord for urgent help.
🚀 Welcome to the cohort.
… renderer
Description
In Renderer._renderDiffLine, if a changed cell is a wide-character continuation cell (visual width = 0), the method correctly adjusts the starting column backwards to the primary cell (adjustedStart = Renderer._adjustSpanStart(...)) and generates a cursor moveTo for the primary cell. However, the subsequent render loop for (let sc = spanStart; sc < c; sc++) still starts at spanStart (the continuation cell) rather than adjustedStart. As a result, the terminal cursor is moved to the primary cell's column, but the character printed there is the continuation cell's character (often empty), shifting the actual characters to the left and corrupting the visual alignment of the line.
Related Issue
Closes #2006
Which package(s)?
Renderer.ts
Type of Change
type:bug)type:feature)type:docs)type:testing)type:refactor)type:design)type:accessibility)type:performance)type:devops)type:security)Checklist
needs-starcheck blocks your merge otherwise.bun vitest runbun run buildbun run typecheckCONTRIBUTING.md.type: short description.markDirty()(if your change affects rendering).anytypes without an inline comment explaining why.GSSoC 2026 Participation
Screenshots / Recordings (UI changes)
Notes for the Reviewer
Summary by CodeRabbit