Add the ability to make new directories by adding slashes to a file name

This commit is contained in:
Mikayla Maki 2023-06-21 15:23:52 -07:00
parent f6b64dc67a
commit 33f5248d4f
No known key found for this signature in database
10 changed files with 259 additions and 8 deletions

View file

@ -1001,10 +1001,25 @@ impl LocalWorktree {
cx.spawn(|this, mut cx| async move {
write.await?;
this.update(&mut cx, |this, cx| {
this.as_local_mut().unwrap().refresh_entry(path, None, cx)
})
.await
let (result, refreshes) = this.update(&mut cx, |this, cx| {
let mut refreshes = Vec::new();
for path in path.ancestors().skip(1) {
refreshes.push(this.as_local_mut().unwrap().refresh_entry(
path.into(),
None,
cx,
));
}
(
this.as_local_mut().unwrap().refresh_entry(path, None, cx),
refreshes,
)
});
for refresh in refreshes {
refresh.await.log_err();
}
result.await
})
}