mirror of
https://github.com/sharkdp/bat.git
synced 2025-02-21 20:38:44 +00:00
print additional newline if last line in input file was not terminated with a newline (fixes #299)
This commit is contained in:
parent
0fe3badf19
commit
e1ecc17f69
@ -243,6 +243,10 @@ impl<'a> Printer for InteractivePrinter<'a> {
|
|||||||
)).collect::<Vec<_>>()
|
)).collect::<Vec<_>>()
|
||||||
.join("")
|
.join("")
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
|
if line.bytes().next_back() != Some(b'\n') {
|
||||||
|
write!(handle, "\n")?;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
for &(style, region) in regions.iter() {
|
for &(style, region) in regions.iter() {
|
||||||
let mut ansi_iterator = AnsiCodeIterator::new(region);
|
let mut ansi_iterator = AnsiCodeIterator::new(region);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user