Skip to content

Commit

Permalink
feat: Set term_width for Renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
Muscraft committed Mar 20, 2024
1 parent 96bbaa1 commit f983e20
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/cargo/util/toml/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,12 @@ fn emit_diagnostic(
.line_start(line_num + 1)
.annotation(Level::Error.span(highlight_start..highlight_end)),
);
let renderer = Renderer::styled();
let renderer = Renderer::styled().term_width(
gctx.shell()
.err_width()
.diagnostic_terminal_width()
.unwrap_or(annotate_snippets::renderer::DEFAULT_TERM_WIDTH),
);
if let Err(err) = writeln!(gctx.shell().err(), "{}", renderer.render(message)) {
return err.into();
}
Expand Down

0 comments on commit f983e20

Please sign in to comment.