1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-29 21:44:24 +03:00

termwiz: treat graphemes in Unassigned range as width=1 rather than 0

Otherwise we filter them out of the terminal model and they effectively
vanish.

refs: #1864
This commit is contained in:
Wez Furlong 2022-04-12 09:52:03 -07:00
parent c1d7ca96db
commit 132377cc33

View File

@ -881,7 +881,13 @@ pub fn grapheme_column_width(s: &str, version: Option<UnicodeVersion>) -> usize
.chars() .chars()
.map(|c| { .map(|c| {
let c = WcWidth::from_char(c); let c = WcWidth::from_char(c);
if version >= 9 {
// Special case for symbol fonts that are naughtly and use
// the unassigned range instead of the private use range.
// <https://github.com/wez/wezterm/issues/1864>
if c == WcWidth::Unassigned {
1
} else if version >= 9 {
c.width_unicode_9_or_later() c.width_unicode_9_or_later()
} else { } else {
c.width_unicode_8_or_earlier() c.width_unicode_8_or_earlier()