@@ -360,14 +360,14 @@ impl Buffer {
360360 let mut start_index = self.index_of(x, y);
361361 let mut index = self.index_of(max_offset as u16, y);
362362
363− let total_width = string.width();
364− let truncated = total_width > width;
363+ let content_width = string.width();
364+ let truncated = content_width > width;
365365 if ellipsis && truncated {
366366 self.content[start_index].set_symbol("…");
367367 start_index += 1;
368368 }
369369 if !truncated {
370− index -= width - total_width;
370+ index -= width - content_width;
371371 }
372372 for (byte_offset, s) in graphemes.rev() {
373373 let width = s.width();
@@ -384,6 +384,7 @@ impl Buffer {
384384 self.content[i].reset();
385385 }
386386 index -= width;
387+ x_offset += width;
387388 }
388389 }
389390 (x_offset as u16, y)