@@ -360,14 +360,14 @@ impl Buffer {
360 let mut start_index = self.index_of(x, y);
360 let mut start_index = self.index_of(x, y);
361 let mut index = self.index_of(max_offset as u16, y);
361 let mut index = self.index_of(max_offset as u16, y);
363− let total_width = string.width();
363+ let content_width = string.width();
364− let truncated = total_width > width;
364+ let truncated = content_width > width;
365 if ellipsis && truncated {
365 if ellipsis && truncated {
366 self.content[start_index].set_symbol("…");
366 self.content[start_index].set_symbol("…");
367 start_index += 1;
367 start_index += 1;
369 if !truncated {
369 if !truncated {
370− index -= width - total_width;
370+ index -= width - content_width;
372 for (byte_offset, s) in graphemes.rev() {
372 for (byte_offset, s) in graphemes.rev() {
373 let width = s.width();
373 let width = s.width();
@@ -384,6 +384,7 @@ impl Buffer {
384 self.content[i].reset();
384 self.content[i].reset();
386 index -= width;
386 index -= width;
389 (x_offset as u16, y)
390 (x_offset as u16, y)