fix unicode characters in line printing (#4420)

* fix unicode characters in line printing

* remove outdated comment
This commit is contained in:
Jonathan Kelley authored and GitHub committed 2025-07-15 11:52:49 -07:00
1 parent f2c6fb2616
commit 393246b923
2 files changed
+38 -97

No files matched your search

+2 -8
View File
@@ -1,5 +1,5 @@
use crate::{
serve::{ansi_buffer::AnsiStringLine, ServeUpdate, WebServer},
serve::{ansi_buffer::ansi_string_to_line, ServeUpdate, WebServer},
BuildId, BuildStage, BuilderUpdate, Platform, TraceContent, TraceMsg, TraceSrc,
};
use cargo_metadata::diagnostic::Diagnostic;
@@ -1022,13 +1022,7 @@ impl Output {
line = line.dark_gray();
}
// Create the ansi -> raw string line with a width of either the viewport width or the max width
let line_length = line.styled_graphemes(Style::default()).count();
if line_length < u16::MAX as usize {
lines.push(AnsiStringLine::new(line_length as _).render(&line));
} else {
lines.push(line.to_string())
}
lines.push(ansi_string_to_line(line));
}
}