replace newlines with spaces in set_string_truncated_at_end

This commit is contained in:
Pascal Sommer 2024-07-07 20:43:51 +02:00
parent 0c8d51ee36
commit 42a6201856

View File

@ -409,6 +409,8 @@ pub fn set_string_truncated_at_end(
let max_x_offset = min(self.area.right() as usize, width.saturating_add(x as usize)); let max_x_offset = min(self.area.right() as usize, width.saturating_add(x as usize));
for s in string.graphemes(true) { for s in string.graphemes(true) {
let s = if s == "\n" { " " } else { s };
let width = s.width(); let width = s.width();
if width == 0 { if width == 0 {
continue; continue;