diff options
author | nwin <nwin@users.noreply.github.com> | 2015-02-22 17:21:57 +0100 |
---|---|---|
committer | nwin <nwin@users.noreply.github.com> | 2015-02-22 17:21:57 +0100 |
commit | df909272a10a1eadc4f8c1101b547998ef95897e (patch) | |
tree | f738609e516e151868ad33843c639bcd26c85f4b /src/column.rs | |
parent | a4e17193d990340b163efceff8eb5e513199d704 (diff) |
Count the number of grapheme clusters to determine the cell length.
Diffstat (limited to 'src/column.rs')
-rw-r--r-- | src/column.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/column.rs b/src/column.rs index 11aae59..1a348ec 100644 --- a/src/column.rs +++ b/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(), } } } |