mirror of
https://github.com/zed-industries/zed.git
synced 2024-10-25 16:09:44 +00:00
Async-ify head text loading
This commit is contained in:
parent
6633c0b328
commit
8edee9b2a8
1 changed files with 7 additions and 1 deletions
|
@ -573,7 +573,13 @@ impl LocalWorktree {
|
|||
let fs = self.fs.clone();
|
||||
cx.spawn(|this, mut cx| async move {
|
||||
let text = fs.load(&abs_path).await?;
|
||||
let head_text = fs.load_head_text(&abs_path).await;
|
||||
|
||||
let head_text = {
|
||||
let fs = fs.clone();
|
||||
let abs_path = abs_path.clone();
|
||||
let task = async move { fs.load_head_text(&abs_path).await };
|
||||
cx.background().spawn(task).await
|
||||
};
|
||||
|
||||
// Eagerly populate the snapshot with an updated entry for the loaded file
|
||||
let entry = this
|
||||
|
|
Loading…
Reference in a new issue