mirror of
https://github.com/sharkdp/hexyl.git
synced 2026-10-28 08:05:52 +00:00
display input offset
This commit is contained in:
1 parent
22b544393b
commit
91a119f453
1 file changed
+6
-3
+6
-3
@@ -91,7 +91,8 @@ impl<'a> Printer<'a> {
|
||||
fn header(&mut self) {
|
||||
writeln!(
|
||||
self.stdout,
|
||||
"┌{}┬{}┬{}┬{}┐",
|
||||
"┌{}┬{}┬{}┬{}┬{}┐",
|
||||
"─".repeat(8),
|
||||
"─".repeat(3 * 8 + 1),
|
||||
"─".repeat(3 * 8 + 1),
|
||||
"─".repeat(8),
|
||||
@@ -102,7 +103,8 @@ impl<'a> Printer<'a> {
|
||||
fn footer(&mut self) {
|
||||
writeln!(
|
||||
self.stdout,
|
||||
"└{}┴{}┴{}┴{}┘",
|
||||
"└{}┴{}┴{}┴{}┴{}┘",
|
||||
"─".repeat(8),
|
||||
"─".repeat(3 * 8 + 1),
|
||||
"─".repeat(3 * 8 + 1),
|
||||
"─".repeat(8),
|
||||
@@ -112,7 +114,8 @@ impl<'a> Printer<'a> {
|
||||
|
||||
fn print_byte(&mut self, b: u8) -> io::Result<()> {
|
||||
if self.idx % 16 == 1 {
|
||||
write!(self.stdout, "│ ");
|
||||
let byte_str = format!("{:08x}", self.idx - 1);
|
||||
write!(self.stdout, "│{}│ ", Byte(0x00).color().paint(byte_str))?;
|
||||
}
|
||||
|
||||
let byte_str = format!("{:02x} ", b);
|
||||
|
||||
Reference in new issue
Block a user