mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
b0771e4994
commit
93289284f8
1 changed files with 7 additions and 7 deletions
|
|
@ -180,19 +180,19 @@ impl Manager {
|
|||
|
||||
if let Ok(name) = result.await {
|
||||
let path = cwd.join(&name);
|
||||
let hovered = path.components().take(cwd.components().count() + 1).collect::<PathBuf>();
|
||||
|
||||
if name.ends_with('/') {
|
||||
fs::create_dir_all(&path).await?;
|
||||
fs::create_dir_all(path).await?;
|
||||
} else {
|
||||
fs::create_dir_all(path.parent().unwrap()).await?;
|
||||
fs::File::create(&path).await.ok();
|
||||
fs::create_dir_all(path.parent().unwrap()).await.ok();
|
||||
fs::File::create(path).await?;
|
||||
}
|
||||
|
||||
let path = path.components().take(cwd.components().count() + 1).collect::<PathBuf>();
|
||||
if let Ok(file) = File::from(&path).await {
|
||||
if let Ok(file) = File::from(&hovered).await {
|
||||
emit!(Hover(file));
|
||||
emit!(Refresh);
|
||||
}
|
||||
|
||||
emit!(Refresh);
|
||||
}
|
||||
Ok::<(), Error>(())
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue