diff --git a/src/preprocessor.rs b/src/preprocessor.rs index eb878890..7001ec88 100644 --- a/src/preprocessor.rs +++ b/src/preprocessor.rs @@ -72,7 +72,7 @@ pub fn replace_nonprintable(input: &[u8], tab_width: usize) -> String { } } // line feed - '\x0A' => output.push('␊'), + '\x0A' => output.push_str("␊\x0A"), // carriage return '\x0D' => output.push('␍'), // null diff --git a/src/printer.rs b/src/printer.rs index ba74872a..b240f83f 100644 --- a/src/printer.rs +++ b/src/printer.rs @@ -91,9 +91,6 @@ impl<'a> Printer for SimplePrinter<'a> { if self.config.show_nonprintable { let line = replace_nonprintable(line_buffer, self.config.tab_width); write!(handle, "{}", line)?; - if line_buffer.last() == Some(&b'\n') { - writeln!(handle)?; - } } else { handle.write_all(line_buffer)? };