Kaynağa Gözat

Count the number of grapheme clusters to determine the cell length.

nwin 11 yıl önce
ebeveyn
işleme
df909272a1
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. 1 1
      src/column.rs

+ 1 - 1
src/column.rs

@@ -86,7 +86,7 @@ impl Cell {
     pub fn paint(style: Style, string: &str) -> Cell {
         Cell {
             text: style.paint(string).to_string(),
-            length: string.len(),
+            length: string.graphemes(true).count(),
         }
     }
 }