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 committed 2022-04-12 09:52:03 -07:00
1 parent c1d7ca96db
commit 132377cc33
1 file changed
+7 -1
+7 -1
View File
@@ -881,7 +881,13 @@ pub fn grapheme_column_width(s: &str, version: Option<UnicodeVersion>) -> usize
.chars()
.map(|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()
} else {
c.width_unicode_8_or_earlier()