Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Character count is incorrect for non-ASCII commit messages #1726

Closed
eclairevoyant opened this issue Jun 20, 2023 · 0 comments
Closed

Character count is incorrect for non-ASCII commit messages #1726

eclairevoyant opened this issue Jun 20, 2023 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@eclairevoyant
Copy link

eclairevoyant commented Jun 20, 2023

Describe the bug
When typing non-ASCII characters in a commit message, the character count is incorrect.
Example: 测试 is counted as 6 characters.

To Reproduce
Create a commit message containing emoji, CJK, or other non-ASCII Unicode characters.

Expected behavior
测试 should be counted as either 2 graphemes or 4 columns.

Emoji width is probably impossible to get right due to variations in presentation schemes, so I don't have strong opinions on how this case should be addressed.

Screenshots

Context (please complete the following information):

  • OS/Distro + Version: Linux
  • GitUI Version 0.23.0
  • Rust version: 1.70.04

Additional context

I'm happy to submit a PR, in fact am working on one now, but I wanted to confirm the expected design here first.

Do we want to count graphemes or columns?

To me, columns make more sense as the whole intention of that informal spec of limiting to 50 (printable ASCII) characters is to make it fit visually on the screen. Counting graphemes sounds more like fun-to-know but not-useful info.

@eclairevoyant eclairevoyant added the bug Something isn't working label Jun 20, 2023
@extrawurst extrawurst added this to the v0.24 milestone Jun 20, 2023
IndianBoy42 pushed a commit to IndianBoy42/gitui that referenced this issue Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants