We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
split_long_word() may split multi-codepoint characters, such as â (a + ◌̂ in NFD) and 🇺🇳, in the middle.
split_long_word()
a
◌̂
use comfy_table::utils::formatting::content_split::split_long_word; use unicode_width::UnicodeWidthStr; fn main() { let emoji = "🙂↕️"; // U+1F642 U+200D U+2195 U+FE0F head shaking vertically assert_eq!(emoji.len(), 13); assert_eq!(emoji.chars().count(), 4); assert_eq!(emoji.width(), 2); let (word, remaining) = split_long_word(emoji.width(), &emoji); println!("{word}"); assert_eq!(word, "\u{1F642}\u{200D}"); assert_eq!(word.len(), 7); assert_eq!(word.chars().count(), 2); assert_eq!(word.width(), 2); println!("{remaining}"); assert_eq!(remaining, "\u{2195}\u{FE0F}"); assert_eq!(remaining.len(), 6); assert_eq!(remaining.chars().count(), 2); assert_eq!(remaining.width(), 2); }
No response
macOS 15.2
v7.1.3
The text was updated successfully, but these errors were encountered:
unicode-rs provides a library to handle clusterng - https://github.com/unicode-rs/unicode-segmentation
Maybe we can see if it helps.
Sorry, something went wrong.
Patch is released :)
Successfully merging a pull request may close this issue.
Describe the bug
split_long_word()
may split multi-codepoint characters, such as â (a
+◌̂
in NFD) and 🇺🇳, in the middle.Steps to reproduce
Logs (if applicable)
No response
Operating system
macOS 15.2
Comfy-table version
v7.1.3
Additional context
No response
The text was updated successfully, but these errors were encountered: