diff --git a/Cargo.lock b/Cargo.lock index f224691..c75ccda 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -297,7 +297,7 @@ dependencies = [ [[package]] name = "grip-grab" -version = "0.2.6" +version = "0.2.8" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index 9e68410..10694e0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "grip-grab" -version = "0.2.6" +version = "0.2.8" edition = "2021" authors = ["Alexandre Pasmantier "] license = "Apache-2.0" diff --git a/src/main.rs b/src/main.rs index 2b5857f..8178ca4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -63,6 +63,5 @@ pub fn main() -> anyhow::Result<()> { .for_each(|file_results| printer.write(file_results).unwrap()); printer.print()?; - Ok(()) } diff --git a/src/printer.rs b/src/printer.rs index 4a7d54a..fe968f9 100644 --- a/src/printer.rs +++ b/src/printer.rs @@ -131,6 +131,12 @@ impl Printer { } pub fn print(&mut self) -> Result<()> { - self.writer.print(&self.buffer) + self.writer.print(&self.buffer); + self.reset_ansi_formatting() + } + + fn reset_ansi_formatting(&mut self) -> Result<()> { + self.buffer.reset(); + self.write_newline_to_buffer() } }