mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
avoid overflow
This commit is contained in:
parent
f9f79df0eb
commit
7bcc32857d
1 changed files with 5 additions and 5 deletions
|
|
@ -187,12 +187,12 @@ impl Tasks {
|
|||
pub fn file_remove(&self, targets: Vec<PathBuf>, permanently: bool) -> bool {
|
||||
let scheduler = self.scheduler.clone();
|
||||
tokio::spawn(async move {
|
||||
let question = if permanently {
|
||||
"Are you sure to delete selected file(s) permanently?"
|
||||
let s = if targets.len() > 1 { 's' } else { ' ' };
|
||||
let result = emit!(Input(InputOpt::hovered(if permanently {
|
||||
format!("Sure to delete selected file{s} permanently? (y/N)")
|
||||
} else {
|
||||
"Are you sure to move selected file(s) to trash bin?"
|
||||
};
|
||||
let result = emit!(Input(InputOpt::hovered(format!("{question} (y/N)"))));
|
||||
format!("Sure to move selected file{s} to trash? (y/N)")
|
||||
})));
|
||||
|
||||
if let Ok(choice) = result.await {
|
||||
if choice.to_lowercase() != "y" {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue