summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index 78c794cb..773f3432 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -199,7 +199,12 @@ fn print_file(
Ok(0) => {
break;
}
- Ok(_) => &line_buffer,
+ Ok(_) => {
+ if !line_buffer.ends_with("\n") {
+ line_buffer.push('\n');
+ }
+ &line_buffer
+ }
Err(_) => "<bat: INVALID UTF-8>\n",
};