Browse Source

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

nwin 11 năm trước cách đây
mục cha
commit
df909272a1
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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(),
         }
     }
 }