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

This commit is contained in:
nwin 2015-02-22 17:21:57 +01:00
parent a4e17193d9
commit df909272a1

View File

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