Using convenience method and using extended clusters as recommended.

This commit is contained in:
nwin 2015-02-22 18:36:11 +01:00
parent df909272a1
commit 8ac16fad8a
2 changed files with 2 additions and 2 deletions

View File

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

View File

@ -173,7 +173,7 @@ impl<'a> File<'a> {
/// characters are 1 columns wide, but in some contexts, certain
/// characters are actually 2 columns wide.
pub fn file_name_width(&self) -> usize {
self.name.as_slice().width(false)
self.name.as_slice().width(true)
}
/// Assuming the current file is a symlink, follows the link and