From 913a92d610f0d96be08d380a457b1872b9f82bb4 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: Mon, 24 Mar 2025 16:06:35 +0800 Subject: [PATCH] feat: allow repositioning the cursor in the `rename` DDS event (#2521) --- yazi-core/src/mgr/commands/rename.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/yazi-core/src/mgr/commands/rename.rs b/yazi-core/src/mgr/commands/rename.rs index a78ff5cf..4a9bb4ba 100644 --- a/yazi-core/src/mgr/commands/rename.rs +++ b/yazi-core/src/mgr/commands/rename.rs @@ -84,7 +84,6 @@ impl Mgr { ok_or_not_found(fs::rename(p_new.join(&o), &new).await)?; FilesOp::Deleting(p_new.clone(), HashSet::from_iter([UrnBuf::from(o)])).emit(); } - Pubsub::pub_from_rename(tab, &old, &new); let file = File::from(new.clone()).await?; if p_new == p_old { @@ -94,7 +93,9 @@ impl Mgr { FilesOp::Upserting(p_new, HashMap::from_iter([(n_new, file)])).emit(); } - Ok(TabProxy::reveal(&new)) + TabProxy::reveal(&new); + Pubsub::pub_from_rename(tab, &old, &new); + Ok(()) } fn empty_url_part(url: &Url, by: &str) -> String {