From e45f0375eb4bf033e92fff49fb90243dd6464de1 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Fri, 24 Nov 2023 22:36:58 +0800 Subject: [PATCH] .. --- yazi-core/src/manager/commands/rename.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yazi-core/src/manager/commands/rename.rs b/yazi-core/src/manager/commands/rename.rs index 55c522fa..ad5c988d 100644 --- a/yazi-core/src/manager/commands/rename.rs +++ b/yazi-core/src/manager/commands/rename.rs @@ -1,4 +1,4 @@ -use std::{ffi::OsStr, io::{stdout, BufWriter, Write}, path::PathBuf}; +use std::{collections::BTreeMap, ffi::OsStr, io::{stdout, BufWriter, Write}, path::PathBuf}; use anyhow::{anyhow, bail, Result}; use tokio::{fs::{self, OpenOptions}, io::{stdin, AsyncReadExt, AsyncWriteExt}}; @@ -23,7 +23,7 @@ impl Manager { } let file = File::from(new.clone()).await?; - emit!(Files(FilesOp::Replacing(file.parent().unwrap(), file.into_map()))); + emit!(Files(FilesOp::Replacing(file.parent().unwrap(), BTreeMap::from_iter([(old, file)])))); Ok(Self::_hover(Some(new))) }