mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
fix: stepwise renaming causes uncertain sorting order
This commit is contained in:
parent
56b0611f7c
commit
db61951001
1 changed files with 3 additions and 7 deletions
|
|
@ -1,4 +1,4 @@
|
|||
use std::{collections::BTreeSet, ffi::OsStr, io::{stdout, BufWriter, Write}, path::PathBuf};
|
||||
use std::{ffi::OsStr, io::{stdout, BufWriter, Write}, path::PathBuf};
|
||||
|
||||
use anyhow::{anyhow, bail, Result};
|
||||
use tokio::{fs::{self, OpenOptions}, io::{stdin, AsyncReadExt, AsyncWriteExt}};
|
||||
|
|
@ -22,13 +22,9 @@ impl Manager {
|
|||
return Ok(());
|
||||
}
|
||||
|
||||
let parent = old.parent_url().unwrap();
|
||||
emit!(Files(FilesOp::Deleting(parent, BTreeSet::from([old]))));
|
||||
|
||||
let file = File::from(new.clone()).await?;
|
||||
emit!(Files(FilesOp::Creating(file.parent().unwrap(), file.into_map())));
|
||||
Self::_hover(Some(new));
|
||||
Ok(())
|
||||
emit!(Files(FilesOp::Replacing(file.parent().unwrap(), file.into_map())));
|
||||
Ok(Self::_hover(Some(new)))
|
||||
}
|
||||
|
||||
pub fn rename(&self, opt: impl Into<Opt>) -> bool {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue