Skip to content

fix: align URL hint hit-box with wide/multibyte glyphs#1627

Open
nikicat wants to merge 1 commit into
raphamorim:mainfrom
nikicat:fix/url-hint-hitbox
Open

fix: align URL hint hit-box with wide/multibyte glyphs#1627
nikicat wants to merge 1 commit into
raphamorim:mainfrom
nikicat:fix/url-hint-hitbox

Conversation

@nikicat
Copy link
Copy Markdown

@nikicat nikicat commented May 30, 2026

Summary

Fixes #1619. The clickable-URL underline and hit-region were horizontally
misaligned when a wide (emoji/CJK) or multibyte glyph preceded the URL on the
same line.

Details

Regex hint extraction pushed cell.c() for every column (spacer placeholders
included) and then used onig byte offsets directly as grid columns, so a wide
glyph or multibyte codepoint earlier on the line shifted the underline and click
target right by the difference between byte count and cell count. This threads a
byte-offset → grid-column map through both call sites and accounts for the
trailing wide-cell spacer.

Testing

cargo test -p rioterm — adds regression coverage for emoji, CJK,
multibyte-narrow, post-processing, and the real-world ⏺ https:// trigger from
the bug report.

Closes #1619

🤖 Generated with Claude Code

Closes raphamorim#1619. Regex hint extraction pushed `cell.c()` for every column
(spacer placeholders included) and then used onig byte offsets directly
as grid columns, so a wide glyph or multibyte codepoint earlier on the
line shifted the underline and click target right by the difference
between byte count and cell count. Threaded a byte-offset → grid column
map through both call sites and added regression coverage for emoji,
CJK, multibyte-narrow, post-processing, and the real-world `⏺ https://`
trigger from the bug report.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
(cherry picked from commit 194b694)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Clickable URL underline/hit-region is horizontally misaligned when a wide (emoji/CJK) glyph precedes the URL on the same line

1 participant