Skip to content

Commit a70eb29

Browse files
authored
Add color to offsets printed by wasmprinter (#2265)
Helps distinguish the offsets from the rest of the file.
1 parent 3a207bd commit a70eb29

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

crates/wasmprinter/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1571,7 +1571,11 @@ impl Printer<'_, '_> {
15711571

15721572
if self.config.print_offsets {
15731573
match offset {
1574-
Some(offset) => write!(self.result, "(;@{offset:<6x};)")?,
1574+
Some(offset) => {
1575+
self.result.start_comment()?;
1576+
write!(self.result, "(;@{offset:<6x};)")?;
1577+
self.result.reset_color()?;
1578+
}
15751579
None => self.result.write_str(" ")?,
15761580
}
15771581
}

0 commit comments

Comments
 (0)