From 49919cc5f44902a33ae5999c98f1e526e6731ccc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E9=9B=85=20=C2=B7=20Misaki=20Masa?= Date: Sat, 11 Nov 2023 08:58:34 +0800 Subject: [PATCH] feat: display the number of deleted files in the prompt (#359) --- yazi-core/src/manager/commands/quit.rs | 5 ++--- yazi-core/src/tasks/tasks.rs | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/yazi-core/src/manager/commands/quit.rs b/yazi-core/src/manager/commands/quit.rs index 41304dbb..d1eb0fcd 100644 --- a/yazi-core/src/manager/commands/quit.rs +++ b/yazi-core/src/manager/commands/quit.rs @@ -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" { diff --git a/yazi-core/src/tasks/tasks.rs b/yazi-core/src/tasks/tasks.rs index 8cc1b52f..a7e90f25 100644 --- a/yazi-core/src/tasks/tasks.rs +++ b/yazi-core/src/tasks/tasks.rs @@ -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 {