fix space rendering for partial chunks

This commit is contained in:
alice pellerin
2026-03-22 20:09:47 -05:00
parent 4c3e91930f
commit a6cf1831c0
2 changed files with 13 additions and 11 deletions
+13 -10
View File
@@ -188,16 +188,19 @@ mod hex {
bytes: &[u8] bytes: &[u8]
) -> impl Iterator<Item=Span<'static>> { ) -> impl Iterator<Item=Span<'static>> {
#[allow(unstable_name_collisions)] #[allow(unstable_name_collisions)]
bytes iter::once(self.render_large_space_before(address))
.iter() .chain(
.copied() bytes
.zip(address..) .iter()
.map(|(byte, address)| self.render_byte_at(address, byte)) .copied()
.interleave( .zip(address..)
(address..) .map(|(byte, address)| self.render_byte_at(address, byte))
.take(BYTES_PER_CHUNK) .interleave(
.skip(1) (address..)
.map(|address| self.render_space_before(address)) .take(BYTES_PER_CHUNK)
.skip(1)
.map(|address| self.render_space_before(address))
)
) )
} }
-1
View File
@@ -27,7 +27,6 @@ const LINES_OF_PADDING: usize = 5;
const BYTES_OF_PADDING: usize = LINES_OF_PADDING * BYTES_PER_LINE; const BYTES_OF_PADDING: usize = LINES_OF_PADDING * BYTES_PER_LINE;
// TODO: // TODO:
// - some way to inspect just one interpretation
// - search // - search
// - ascii and bytes (`/` and `A-/`?) // - ascii and bytes (`/` and `A-/`?)
// - diffing // - diffing