summaryrefslogtreecommitdiffstats
path: root/ui/src/terminal/grapheme_clusters.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ui/src/terminal/grapheme_clusters.rs')
-rw-r--r--ui/src/terminal/grapheme_clusters.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/ui/src/terminal/grapheme_clusters.rs b/ui/src/terminal/grapheme_clusters.rs
index ce1fe79f..69303e19 100644
--- a/ui/src/terminal/grapheme_clusters.rs
+++ b/ui/src/terminal/grapheme_clusters.rs
@@ -27,14 +27,10 @@ pub trait Graphemes: UnicodeSegmentation + CodePointsIter {
UnicodeSegmentation::grapheme_indices(self, true).next_back()
}
- fn grapheme_width(&self) -> i32 {
+ fn grapheme_width(&self) -> usize {
let mut count = 0;
for c in self.code_points() {
- count += if let Some(c) = wcwidth(c) {
- c as i32
- } else {
- -1
- };
+ count += if let Some(c) = wcwidth(c) { c } else { 0 };
}
count