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