From 71fa918564f368cc3623a0d6a6cb0704110ac53f Mon Sep 17 00:00:00 2001 From: Young-Flash Date: Thu, 26 Dec 2024 11:19:24 +0800 Subject: [PATCH] fix progress line overwrite moonc diagnostic --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/progress.rs | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 88bf757..4bfcc6e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -369,7 +369,7 @@ checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "n2" -version = "0.1.4" +version = "0.1.5" dependencies = [ "anyhow", "argh", diff --git a/Cargo.toml b/Cargo.toml index 0c23053..fbd62c4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "n2" -version = "0.1.4" +version = "0.1.5" categories = ["development-tools", "development-tools::build-utils"] edition = "2018" exclude = [".github/*", ".vscode/*"] diff --git a/src/progress.rs b/src/progress.rs index 0ab62af..105fba9 100644 --- a/src/progress.rs +++ b/src/progress.rs @@ -275,6 +275,9 @@ impl FancyState { fn task_finished(&mut self, id: BuildId, build: &Build, result: &TaskResult) { self.tasks .remove(self.tasks.iter().position(|t| t.id == id).unwrap()); + + self.clear_progress(); + match result.termination { Termination::Success => { // Common case: don't show anything. @@ -298,6 +301,8 @@ impl FancyState { std::io::stdout().write_all(&result.output).unwrap(); } } + + // mark as dirty to trigger progress update self.dirty(); }