Skip to content

fix(git): preserve grapheme clusters in fish-style abbreviations - #790

Merged
sirmalloc merged 4 commits into
sirmalloc:mainfrom
wozhenbang2004:fix/git-grapheme-abbreviation
Nov 5, 2026
Merged

sirmalloc merged 4 commits into
sirmalloc:mainfrom
wozhenbang2004:fix/git-grapheme-abbreviation

Conversation

@wozhenbang2004

Copy link
Copy Markdown
Contributor

Fixes #789.

Use the existing getGraphemes helper when abbreviating Git branch and worktree names. The first displayed character now stays intact for flags, ZWJ emoji, combining marks, skin-tone modifiers, and variation selectors. The final path segment and unabridged names keep their current behavior.

Adds fourteen rendering cases across the existing widget tests, including single-segment names and a final-segment control. The new failing cases use clusters at the start of a segment, where fish-style abbreviation actually truncates.

Validation:

No dependency or runtime-floor changes; this reuses the helper's existing fallback for runtimes without Intl.Segmenter.

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.

Fish-style abbreviation splits multi-codepoint graphemes (flags, ZWJ emoji, combining marks)

2 participants