mirror of
https://github.com/sharkdp/hexyl.git
synced 2026-10-26 20:16:31 +00:00
Adjust color function to not take character_table as arg
This commit is contained in:
1 parent
a56b3b0c46
commit
1310b1d19e
1 file changed
+6
-8
+6
-8
@@ -449,11 +449,9 @@ impl<'a, Writer: Write> Printer<'a, Writer> {
|
||||
Squeezer::Print | Squeezer::Delete => self.writer.write_all(b" ")?,
|
||||
Squeezer::Ignore | Squeezer::Disabled => {
|
||||
if let Some(&b) = self.line_buf.get(i as usize) {
|
||||
if self.show_color
|
||||
&& self.curr_color != Some(Byte(b).color(self.character_table))
|
||||
{
|
||||
self.writer.write_all(Byte(b).color(self.character_table))?;
|
||||
self.curr_color = Some(Byte(b).color(self.character_table));
|
||||
if self.show_color && self.curr_color != Some(Byte(b).color()) {
|
||||
self.writer.write_all(Byte(b).color())?;
|
||||
self.curr_color = Some(Byte(b).color());
|
||||
}
|
||||
self.writer
|
||||
.write_all(self.byte_char_panel[b as usize].as_bytes())?;
|
||||
@@ -520,9 +518,9 @@ impl<'a, Writer: Write> Printer<'a, Writer> {
|
||||
if i % (self.group_size as usize) == 0 {
|
||||
self.writer.write_all(b" ")?;
|
||||
}
|
||||
if self.show_color && self.curr_color != Some(Byte(b).color(self.character_table)) {
|
||||
self.writer.write_all(Byte(b).color(self.character_table))?;
|
||||
self.curr_color = Some(Byte(b).color(self.character_table));
|
||||
if self.show_color && self.curr_color != Some(Byte(b).color()) {
|
||||
self.writer.write_all(Byte(b).color())?;
|
||||
self.curr_color = Some(Byte(b).color());
|
||||
}
|
||||
self.writer
|
||||
.write_all(self.byte_hex_panel[b as usize].as_bytes())?;
|
||||
|
||||
Reference in new issue
Block a user