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.

Fix runnables-related hickups (#8058)

Kirill Bulatov48a6fb9e849e
diff --git a/crates/runnable/src/static_source.rs b/crates/runnable/src/static_source.rs
index 3a274b0a12a..9edd7a1afe7 100644
--- a/crates/runnable/src/static_source.rs
+++ b/crates/runnable/src/static_source.rs
@@ -79,7 +79,7 @@ impl<T: for<'a> Deserialize<'a> + PartialEq + 'static> TrackedFile<T> {
) -> Model<Self> {
cx.new_model(move |cx| {
cx.spawn(|tracked_file, mut cx| async move {
- while let Some(new_contents) = tracker.next().await {
+ while let Some(new_contents) = tracker.next().await.filter(|s| !s.is_empty()) {
let Some(new_contents) = serde_json_lenient::from_str(&new_contents).log_err()
else {
continue;
diff --git a/crates/terminal_view/src/terminal_panel.rs b/crates/terminal_view/src/terminal_panel.rs
index aee6e907b65..832132edcce 100644
--- a/crates/terminal_view/src/terminal_panel.rs
+++ b/crates/terminal_view/src/terminal_panel.rs
@@ -542,6 +542,13 @@ impl TerminalPanel {
terminal_to_replace.set_terminal(new_terminal, cx);
});
self.activate_terminal_view(terminal_item_index, cx);
+ let task_workspace = self.workspace.clone();
+ cx.spawn(|_, mut cx| async move {
+ task_workspace
+ .update(&mut cx, |workspace, cx| workspace.focus_panel::<Self>(cx))
+ .ok()
+ })
+ .detach();
Some(())
}
}