diff --git a/crates/diagnostics/src/diagnostics.rs b/crates/diagnostics/src/diagnostics.rs index bfe5ecbe63..fc4dcba3c3 100644 --- a/crates/diagnostics/src/diagnostics.rs +++ b/crates/diagnostics/src/diagnostics.rs @@ -46,6 +46,7 @@ use workspace::{ actions!(diagnostics, [Deploy, ToggleWarnings]); +#[derive(Default)] pub(crate) struct IncludeWarnings(bool); impl Global for IncludeWarnings {} diff --git a/crates/diagnostics/src/items.rs b/crates/diagnostics/src/items.rs index adf2c8e300..26a6c75357 100644 --- a/crates/diagnostics/src/items.rs +++ b/crates/diagnostics/src/items.rs @@ -95,9 +95,9 @@ impl Render for DiagnosticIndicator { .on_click(cx.listener(|this, _, window, cx| { if let Some(workspace) = this.workspace.upgrade() { if this.summary.error_count == 0 && this.summary.warning_count > 0 { - cx.update_global(|show_warnings: &mut IncludeWarnings, _| { - show_warnings.0 = true - }); + cx.update_default_global( + |show_warnings: &mut IncludeWarnings, _| show_warnings.0 = true, + ); } workspace.update(cx, |workspace, cx| { ProjectDiagnosticsEditor::deploy(