Enable reload of images in image viewer (#20374)

Closes #11529

Release Notes:

- Fixed an issue where the image preview would not update when the
underlying file changed

---------

Co-authored-by: Bennet <bennet@zed.dev>
This commit is contained in:
Will Bradley
2024-11-10 11:37:02 +01:00
committed by GitHub
co-authored by Bennet
parent f3320998a8
commit 0dbda71423
10 changed files with 840 additions and 109 deletions
+4 -1
View File
@@ -413,9 +413,12 @@ pub trait LocalFile: File {
/// Returns the absolute path of this file
fn abs_path(&self, cx: &AppContext) -> PathBuf;
/// Loads the file's contents from disk.
/// Loads the file contents from disk and returns them as a UTF-8 encoded string.
fn load(&self, cx: &AppContext) -> Task<Result<String>>;
/// Loads the file's contents from disk.
fn load_bytes(&self, cx: &AppContext) -> Task<Result<Vec<u8>>>;
/// Returns true if the file should not be shared with collaborators.
fn is_private(&self, _: &AppContext) -> bool {
false