feat: display the number of deleted files in the prompt (#359)

This commit is contained in:
三咲雅 · Misaki Masa 2023-11-11 08:58:34 +08:00 committed by GitHub
parent 521c8b6bfe
commit 49919cc5f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

View File

@ -24,9 +24,8 @@ impl Manager {
}
tokio::spawn(async move {
let mut result = emit!(Input(InputOpt::top(format!(
"There are {tasks} tasks running, sure to quit? (y/N)"
))));
let mut result =
emit!(Input(InputOpt::top(format!("{tasks} tasks running, sure to quit? (y/N)"))));
if let Some(Ok(choice)) = result.recv().await {
if choice == "y" || choice == "Y" {

View File

@ -112,9 +112,9 @@ impl Tasks {
tokio::spawn(async move {
let s = if targets.len() > 1 { "s" } else { "" };
let mut result = emit!(Input(InputOpt::hovered(if permanently {
format!("Delete selected file{s} permanently? (y/N)")
format!("Delete {} selected file{s} permanently? (y/N)", targets.len())
} else {
format!("Move selected file{s} to trash? (y/N)")
format!("Move {} selected file{s} to trash? (y/N)", targets.len())
})));
if let Some(Ok(choice)) = result.recv().await {