on master help sign in
print additional newline if last line in input file was not terminated with a newline (fixes #299)
commite1ecc17f69f1d84fb127203a45e4abd88babab07 authorRogach <platon7pronko@gmail.com> dateMon 10 Sep 2018, 22:36 (8 years ago) parent0fe3bad
1 file changed+4
src/printer.rs+4
src/printer.rs+4
@@ -243,6 +243,10 @@ impl<'a> Printer for InteractivePrinter<'a> {
243243 )).collect::<Vec<_>>()
244244 .join("")
245245 )?;
246+
247+ if line.bytes().next_back() != Some(b'\n') {
248+ write!(handle, "\n")?;
249+ }
246250 } else {
247251 for &(style, region) in regions.iter() {
248252 let mut ansi_iterator = AnsiCodeIterator::new(region);