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
Adding support for full-width characters #41
Comments
Do you have a screenshot + sample text example of this? |
How much did you increment the spans by when doing so? And does Rust's |
Usually a CJK character (a character used in China, Japan and Korea) takes the space of two ASCII characters. Rust's |
I'll put it on the list of things to do when I get round to refactoring the crate's internals. Contributions are also welcome of course! |
Going to break my comment in the above PR out here: The PR above fixed some of these issues, but probably not enough for CJK.
|
As a Chinese, I have not seen "ambiguous characters" rendering wide for years. The But the hardcoded width of whitespace is a problem, for there is at least a wide space: Lines 401 to 413 in 06b1748
Regarding this, I come up with two possible solutions.
c if c.is_whitespace() => (' ', c.width().unwrap_or(1)), Both solutions should work well with |
Might just be useless trivia that won't ocur in practice, but another corner case/point in favor of doing that is U+1680 Ogham space mark, a character with a visible representation that is_whitespace(). https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=cb4c89643c03d3557d336623b242912f |
When the source code full-width characters (e.g. CJK characters), underlining is not proper. They might need too spaces.
The text was updated successfully, but these errors were encountered: