Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Add example compilation to CI (#24182)

Mikayla Makid400bdea7657
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 0dee4fc06e4..d458ac78a4b 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -135,6 +135,7 @@ jobs:
cargo check -p gpui --features "macos-blade"
cargo check -p workspace
cargo build -p remote_server
+ cargo check -p gpui --examples
script/check-rust-livekit-macos
# Since the macOS runners are stateful, so we need to remove the config file to prevent potential bug.
@@ -181,6 +182,7 @@ jobs:
run: |
cargo build -p zed
cargo check -p workspace
+ cargo check -p gpui --examples
# Even the Linux runner is not stateful, in theory there is no need to do this cleanup.
# But, to avoid potential issues in the future if we choose to use a stateful Linux runner and forget to add code
diff --git a/crates/gpui/src/elements/img.rs b/crates/gpui/src/elements/img.rs
index d393195e7bf..19eae28982d 100644
--- a/crates/gpui/src/elements/img.rs
+++ b/crates/gpui/src/elements/img.rs
@@ -353,11 +353,15 @@ impl Element for Img {
}
}
} else {
- let parent_view_id = window.parent_view_id().unwrap();
+ let parent_view_id = window.parent_view_id();
let task = window.spawn(cx, |mut cx| async move {
cx.background_executor().timer(LOADING_DELAY).await;
- cx.update(move |_, cx| {
- cx.notify(parent_view_id);
+ cx.update(move |window, cx| {
+ if let Some(parent_view_id) = parent_view_id {
+ cx.notify(parent_view_id);
+ } else {
+ window.refresh();
+ }
})
.ok();
});