Skip to content

Commit

Permalink
print: move intendation for Diag into the /*...*/.
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyb committed May 1, 2023
1 parent a4587be commit 1c59176
Showing 1 changed file with 24 additions and 20 deletions.
44 changes: 24 additions & 20 deletions src/print/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1825,27 +1825,31 @@ impl Print for Attr {
// HACK(eddyb) this would ideally use line comments,
// but adding the line prefix properly to everything
// is a bit of a pain without special `pretty` support.
pretty::Node::InlineOrIndentedBlock(vec![pretty::Fragment::new([
comment_style.clone().apply("/* ").into(),
pretty::Styles {
thickness: Some(3),

// HACK(eddyb) this allows larger "icons"
// without adding gaps via `line-height`.
subscript: true,
size: Some(2),

..pretty::Styles::color(icon_color)
}
.apply(icon)
.into(),
" ".into(),
bug_location_prefix,
printed_message,
comment_style.apply(" */").into(),
])])
pretty::Fragment::new([
comment_style.clone().apply("/*"),
pretty::Node::BreakingOnlySpace,
pretty::Node::InlineOrIndentedBlock(vec![pretty::Fragment::new([
pretty::Styles {
thickness: Some(3),

// HACK(eddyb) this allows larger "icons"
// without adding gaps via `line-height`.
subscript: true,
size: Some(2),

..pretty::Styles::color(icon_color)
}
.apply(icon)
.into(),
" ".into(),
bug_location_prefix,
printed_message,
])]),
pretty::Node::BreakingOnlySpace,
comment_style.apply("*/"),
])
})
.intersperse(pretty::Node::ForceLineSeparation),
.intersperse(pretty::Node::ForceLineSeparation.into()),
),
),

Expand Down

0 comments on commit 1c59176

Please sign in to comment.