Snapshot file instead of path when creating a buffer snapshot

This commit is contained in:
Antonio Scandurra 2022-06-08 14:28:53 +02:00
parent 15b13fe511
commit eda569d6b2
5 changed files with 21 additions and 20 deletions

View file

@ -519,7 +519,7 @@ impl LocalWorktree {
let (file, contents) = this
.update(&mut cx, |t, cx| t.as_local().unwrap().load(&path, cx))
.await?;
Ok(cx.add_model(|cx| Buffer::from_file(0, contents, Box::new(file), cx)))
Ok(cx.add_model(|cx| Buffer::from_file(0, contents, Arc::new(file), cx)))
})
}
@ -648,7 +648,7 @@ impl LocalWorktree {
};
buffer_handle.update(&mut cx, |buffer, cx| {
buffer.did_save(version, file.mtime, Some(Box::new(file)), cx);
buffer.did_save(version, file.mtime, Some(Arc::new(file)), cx);
});
Ok(())