From c4304b8313253f94527d3ed9c07d67ad4ff6141c Mon Sep 17 00:00:00 2001 From: MikuGeek <56752306+MikuGeek@users.noreply.github.com> Date: Mon, 24 Mar 2025 18:06:17 +0800 Subject: [PATCH] Revert "feat: give indication to original filenames in bulk rename" This reverts commit 1a194a877044ae3609c93768867ec7f206114532. --- yazi-core/src/mgr/commands/bulk_rename.rs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/yazi-core/src/mgr/commands/bulk_rename.rs b/yazi-core/src/mgr/commands/bulk_rename.rs index fce3817a..e05b067b 100644 --- a/yazi-core/src/mgr/commands/bulk_rename.rs +++ b/yazi-core/src/mgr/commands/bulk_rename.rs @@ -26,16 +26,12 @@ impl Mgr { tokio::spawn(async move { let tmp = YAZI.preview.tmpfile("bulk"); let s = old.iter().map(|o| o.as_os_str()).collect::>().join(OsStr::new("\n")); - const DIVIDER: &str = "\n<↑ After ↑> <↓ Before ↓>\n"; - - let content = [&s, OsStr::new(&format!("{}", DIVIDER)), &s].join(OsStr::new("")); - OpenOptions::new() .write(true) .create_new(true) .open(&tmp) .await? - .write_all(content.as_encoded_bytes()) + .write_all(s.as_encoded_bytes()) .await?; defer! { tokio::spawn(fs::remove_file(tmp.clone())); } @@ -49,10 +45,7 @@ impl Mgr { defer!(AppProxy::resume()); AppProxy::stop().await; - let content = fs::read_to_string(&tmp).await?; - - let new: Vec<_> = - content.split(DIVIDER).next().unwrap_or("").lines().map(PathBuf::from).collect(); + let new: Vec<_> = fs::read_to_string(&tmp).await?.lines().map(PathBuf::from).collect(); Self::bulk_rename_do(root, old, new).await }); }